BUG-50 : added tests for PCEP TLVs.
[bgpcep.git] / pcep / spi / src / main / java / org / opendaylight / protocol / pcep / spi / pojo / SimpleRROSubobjectHandlerRegistry.java
index 6981dcb2ef29d9d2328d04e0f695d2159d8dbf72..e96788e87de5b69cfdaaeda20f42c32e4b8a9aff 100644 (file)
@@ -11,6 +11,7 @@ import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
+import org.opendaylight.protocol.util.Util;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.Subobjects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
@@ -21,13 +22,13 @@ public final class SimpleRROSubobjectHandlerRegistry implements RROSubobjectHand
        private final HandlerRegistry<DataContainer, RROSubobjectParser, RROSubobjectSerializer> handlers = new HandlerRegistry<>();
 
        public AutoCloseable registerSubobjectParser(final int subobjectType, final RROSubobjectParser parser) {
-               Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
+               Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= Util.UNSIGNED_SHORT_MAX_VALUE);
                return this.handlers.registerParser(subobjectType, parser);
        }
 
        @Override
        public RROSubobjectParser getSubobjectParser(final int subobjectType) {
-               Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
+               Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= Util.UNSIGNED_SHORT_MAX_VALUE);
                return this.handlers.getParser(subobjectType);
        }