X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-java-api-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fjava%2Fapi%2Fgenerator%2FAbstractRangeGenerator.java;h=27c580f9af18f29306e8c8c1a6d111bb7f925863;hb=11408d627adca7eb71ac956c3ad01f75b6b91596;hp=600219c32128ef23595f5012ee31c7307cdc1021;hpb=41eeb416ffcb3146e3a590b58511069fc140d386;p=mdsal.git diff --git a/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/AbstractRangeGenerator.java b/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/AbstractRangeGenerator.java index 600219c321..27c580f9af 100644 --- a/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/AbstractRangeGenerator.java +++ b/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/AbstractRangeGenerator.java @@ -35,12 +35,15 @@ abstract class AbstractRangeGenerator> { addGenerator(b, new ShortRangeGenerator()); addGenerator(b, new IntegerRangeGenerator()); addGenerator(b, new LongRangeGenerator()); - addGenerator(b, new BigDecimalRangeGenerator()); - addGenerator(b, new BigIntegerRangeGenerator()); + addGenerator(b, new Decimal64RangeGenerator()); + addGenerator(b, new Uint8RangeGenerator()); + addGenerator(b, new Uint16RangeGenerator()); + addGenerator(b, new Uint32RangeGenerator()); + addGenerator(b, new Uint64RangeGenerator()); GENERATORS = b.build(); } - private final Class type; + private final @NonNull Class type; protected AbstractRangeGenerator(final Class typeClass) { this.type = requireNonNull(typeClass); @@ -120,7 +123,7 @@ abstract class AbstractRangeGenerator> { protected abstract @NonNull String generateRangeCheckerImplementation(@NonNull String checkerName, @NonNull RangeConstraint constraints, Function, String> classImporter); - private static String rangeCheckerName(final String member) { + private static @NonNull String rangeCheckerName(final String member) { return "check" + member + "Range"; } @@ -130,6 +133,10 @@ abstract class AbstractRangeGenerator> { } String generateRangeCheckerCall(final @NonNull String member, final @NonNull String valueReference) { - return rangeCheckerName(member) + '(' + valueReference + ");\n"; + return rangeCheckerName(member) + '(' + valueReference + primitiveRef() + ");\n"; + } + + String primitiveRef() { + return ""; } }