Fix LeafNode conversions 01/85101/4
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Oct 2019 09:29:29 +0000 (11:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Oct 2019 14:43:07 +0000 (16:43 +0200)
This hunts down the remaining conversions where we assume widened
uint types.

Change-Id: I2db0a10ca207fad90fa1c71ac1b5981b664aa272
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkNlriParser.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/MultiTopoIdTlvParser.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/spi/AbstractTeLspNlriCodec.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateNlriParserTest.java
bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/AsNumberUtil.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java

index 8dc6206814b75c81f7b098fd5306c6aa981b7e39..3a877676a55561354441f70a5385ccc392d570e6 100644 (file)
@@ -88,6 +88,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.SubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
@@ -317,7 +319,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
                 dataContainerChild -> portsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create(
                     (Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
-            valueNode.ifPresent(dataContainerChild -> portsBuilder.setValue((Integer) dataContainerChild.getValue()));
+            valueNode.ifPresent(dataContainerChild -> portsBuilder.setValue((Uint16) dataContainerChild.getValue()));
             ports.add(portsBuilder.build());
         }
 
@@ -332,7 +334,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> destPortsBuilder.setOp(
                 NumericTwoByteOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             node.getChild(VALUE_NID).ifPresent(
-                dataContainerChild -> destPortsBuilder.setValue((Integer) dataContainerChild.getValue()));
+                dataContainerChild -> destPortsBuilder.setValue((Uint16) dataContainerChild.getValue()));
             destinationPorts.add(destPortsBuilder.build());
         }
 
@@ -347,7 +349,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> sourcePortsBuilder.setOp(
                 NumericTwoByteOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             node.getChild(VALUE_NID).ifPresent(
-                dataContainerChild -> sourcePortsBuilder.setValue((Integer) dataContainerChild.getValue()));
+                dataContainerChild -> sourcePortsBuilder.setValue((Uint16) dataContainerChild.getValue()));
             sourcePorts.add(sourcePortsBuilder.build());
         }
 
@@ -362,7 +364,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> typesBuilder.setOp(
                 NumericOneByteOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
-            valueNode.ifPresent(dataContainerChild -> typesBuilder.setValue((Short) dataContainerChild.getValue()));
+            valueNode.ifPresent(dataContainerChild -> typesBuilder.setValue((Uint8) dataContainerChild.getValue()));
             types.add(typesBuilder.build());
         }
 
@@ -378,7 +380,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             opValue.ifPresent(dataContainerChild -> codesBuilder.setOp(NumericOneByteOperandParser
                     .INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
-            valueNode.ifPresent(dataContainerChild -> codesBuilder.setValue((Short) dataContainerChild.getValue()));
+            valueNode.ifPresent(dataContainerChild -> codesBuilder.setValue((Uint8) dataContainerChild.getValue()));
             codes.add(codesBuilder.build());
         }
 
@@ -393,7 +395,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> tcpFlagsBuilder
                     .setOp(BitmaskOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             node.getChild(VALUE_NID).ifPresent(
-                dataContainerChild -> tcpFlagsBuilder.setValue((Integer) dataContainerChild.getValue()));
+                dataContainerChild -> tcpFlagsBuilder.setValue((Uint16) dataContainerChild.getValue()));
             tcpFlags.add(tcpFlagsBuilder.build());
         }
 
@@ -408,7 +410,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> packetLengthsBuilder.setOp(
                 NumericTwoByteOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             node.getChild(VALUE_NID).ifPresent(
-                dataContainerChild -> packetLengthsBuilder.setValue((Integer) dataContainerChild.getValue()));
+                dataContainerChild -> packetLengthsBuilder.setValue((Uint16) dataContainerChild.getValue()));
             packetLengths.add(packetLengthsBuilder.build());
         }
 
@@ -423,7 +425,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
             node.getChild(OP_NID).ifPresent(dataContainerChild -> dscpsLengthsBuilder.setOp(
                 NumericOneByteOperandParser.INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             node.getChild(VALUE_NID).ifPresent(
-                dataContainerChild -> dscpsLengthsBuilder.setValue(new Dscp((Short) dataContainerChild.getValue())));
+                dataContainerChild -> dscpsLengthsBuilder.setValue(new Dscp((Uint8) dataContainerChild.getValue())));
             dscpsLengths.add(dscpsLengthsBuilder.build());
         }
 
index 99607aa9b9ce2c0d685db19889d0357b59183287..4c42454f4c536f4c36a84f69be8002caddd83e0c 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.SourcePrefixCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.protocol.ip._case.ProtocolIps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.protocol.ip._case.ProtocolIpsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
@@ -82,7 +83,7 @@ public final class FlowspecIpv4NlriParserHelper {
                     .INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode
                     = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
-            valueNode.ifPresent(dataContainerChild -> ipsBuilder.setValue((Short) dataContainerChild.getValue()));
+            valueNode.ifPresent(dataContainerChild -> ipsBuilder.setValue((Uint8) dataContainerChild.getValue()));
             protocolIps.add(ipsBuilder.build());
         }
 
index bb47abc6315dba7648012ad168c4fc97f4cf42e4..e98a888b70f9fd78770eb2a6b6f4cb3a8879a890 100644 (file)
@@ -28,6 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.flow.label._case.FlowLabelBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.next.header._case.NextHeaders;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.next.header._case.NextHeadersBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
@@ -89,7 +91,7 @@ public final class FlowspecIpv6NlriParserHelper {
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode
                     = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
             valueNode.ifPresent(
-                dataContainerChild -> nextHeadersBuilder.setValue((Short) dataContainerChild.getValue()));
+                dataContainerChild -> nextHeadersBuilder.setValue((Uint8) dataContainerChild.getValue()));
             nextHeaders.add(nextHeadersBuilder.build());
         }
 
@@ -108,7 +110,7 @@ public final class FlowspecIpv6NlriParserHelper {
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode
                     = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
             valueNode.ifPresent(
-                dataContainerChild -> flowLabelsBuilder.setValue((Long) dataContainerChild.getValue()));
+                dataContainerChild -> flowLabelsBuilder.setValue((Uint32) dataContainerChild.getValue()));
             flowLabels.add(flowLabelsBuilder.build());
         }
 
index 818c8ec7951d74bd0bfe255b924f397d569013d4..eafd07c872d052424344dc0392501ebd22d20aa8 100644 (file)
@@ -97,6 +97,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisherBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -641,19 +643,19 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 100).build()).build())
+                                .withValue(Uint8.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 200).build()).build())
+                                .withValue(Uint8.valueOf(200)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 240).build()).build())
+                                .withValue(Uint8.valueOf(240)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -687,7 +689,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue(100).build()).build())
+                                .withValue(Uint16.valueOf(100)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -717,7 +719,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractNumericOperandParser.EQUALS_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(1024).build()).build())
+                                .withValue(Uint16.valueOf(1024)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(
@@ -749,7 +751,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE,
                                     AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue(8080).build()).build())
+                                .withValue(Uint16.valueOf(8080)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(
@@ -781,7 +783,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE,
                                     AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 22).build()).build())
+                                .withValue(Uint8.valueOf(22)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(
@@ -810,7 +812,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
                                 .withValue(Collections.emptySet()).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 23).build()).build())
+                                .withValue(Uint8.valueOf(23)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder()
@@ -839,7 +841,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
                                     AbstractOperandParser.END_OF_LIST_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue(99).build()).build())
+                                .withValue(Uint16.valueOf(99)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
@@ -868,7 +870,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue(101).build()).build())
+                                .withValue(Uint16.valueOf(101)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(
@@ -898,7 +900,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                     AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
-                                .withValue((short) 15).build()).build())
+                                .withValue(Uint8.valueOf(15)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder().setValue(
index b43b0bf5c914729f4e74ce78d334204c98e0f7ed..6ef79172349bb8a9d8e7b2334b1101362a4069fa 100644 (file)
@@ -68,6 +68,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -428,19 +430,19 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
-                                .withValue((short) 100).build()).build())
+                                .withValue(Uint8.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
-                                .withValue((short) 200).build()).build())
+                                .withValue(Uint8.valueOf(200)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
-                                .withValue((short) 210).build()).build())
+                                .withValue(Uint8.valueOf(210)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -473,12 +475,12 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
-                                .withValue(100L).build()).build())
+                                .withValue(Uint32.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
-                                .withValue(200L).build()).build())
+                                .withValue(Uint32.valueOf(200)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
index 10f6ac0b8912aa550503b08ada05a57c4d84cad4..29db804ecbe6497b7f100a48da8248c0b8832840 100644 (file)
@@ -92,6 +92,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -600,19 +602,19 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 100).build()).build())
+                                .withValue(Uint8.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 200).build()).build())
+                                .withValue(Uint8.valueOf(200)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 240).build()).build())
+                                .withValue(Uint8.valueOf(240)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -647,7 +649,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(100).build()).build())
+                                .withValue(Uint16.valueOf(100)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -677,7 +679,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractNumericOperandParser.EQUALS_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(1024).build()).build())
+                                .withValue(Uint16.valueOf(1024)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(
@@ -709,7 +711,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE,
                                     AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(8080).build()).build())
+                                .withValue(Uint16.valueOf(8080)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(
@@ -741,7 +743,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE,
                                     AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 22).build()).build())
+                                .withValue(Uint8.valueOf(22)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(new TypesBuilder()
@@ -769,7 +771,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Collections.emptySet()).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 23).build()).build())
+                                .withValue(Uint8.valueOf(23)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder()
@@ -798,7 +800,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
                                     AbstractOperandParser.END_OF_LIST_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(99).build()).build())
+                                .withValue(Uint16.valueOf(99)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
@@ -827,7 +829,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(101).build()).build())
+                                .withValue(Uint16.valueOf(101)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(
@@ -857,7 +859,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                     AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 15).build()).build())
+                                .withValue(Uint8.valueOf(15)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder()
index a3cb22f2fc6a0ff5ffe5cfa9e1933b37e32959fd..effcfdd59ac515524877e0fea59cb6dce7b674aa 100644 (file)
@@ -66,6 +66,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -401,19 +403,19 @@ public class SimpleFlowspecIpv6NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 100).build()).build())
+                                .withValue(Uint8.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 200).build()).build())
+                                .withValue(Uint8.valueOf(200)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE))
                                 .build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue((short) 210).build()).build())
+                                .withValue(Uint8.valueOf(210)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
@@ -446,12 +448,12 @@ public class SimpleFlowspecIpv6NlriParserTest {
                                 .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
                                     AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(100L).build()).build())
+                                .withValue(Uint32.valueOf(100)).build()).build())
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID)
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
                                 .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build())
                             .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
-                                .withValue(200L).build()).build())
+                                .withValue(Uint32.valueOf(200)).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
index 1e862816c951136127b76171be8a7388432f62ce..e4bf630462b199bee9ea052551f2dc7ad4fcd58c 100644 (file)
@@ -31,6 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.link
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.LocalNodeDescriptors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.RemoteNodeDescriptors;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -76,7 +77,7 @@ public final class LinkNlriParser extends AbstractNlriTypeCodec {
         ifPresentApply(descriptors, IPV6_NEIGHBOR_NID,
             value -> linkDescBuilder.setIpv6NeighborAddress(new Ipv6InterfaceIdentifier((String) value)));
         ifPresentApply(descriptors, TlvUtil.MULTI_TOPOLOGY_NID,
-            value -> linkDescBuilder.setMultiTopologyId(new TopologyIdentifier((Integer) value)));
+            value -> linkDescBuilder.setMultiTopologyId(new TopologyIdentifier((Uint16) value)));
         return linkDescBuilder.build();
     }
 
index 119b84d2e7e7562b1374234a8385c381afa9ce78..b0eb0b823ef82c4c4148e7ef5d3f8b72e168a537 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.TopologyIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.LinkDescriptors;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 
 public final class MultiTopoIdTlvParser implements LinkstateTlvParser<TopologyIdentifier>,
@@ -44,7 +45,7 @@ public final class MultiTopoIdTlvParser implements LinkstateTlvParser<TopologyId
 
     public static TopologyIdentifier serializeModel(final ContainerNode prefixDesc) {
         if (prefixDesc.getChild(TlvUtil.MULTI_TOPOLOGY_NID).isPresent()) {
-            return new TopologyIdentifier((Integer) prefixDesc.getChild(TlvUtil.MULTI_TOPOLOGY_NID).get().getValue());
+            return new TopologyIdentifier((Uint16) prefixDesc.getChild(TlvUtil.MULTI_TOPOLOGY_NID).get().getValue());
         }
         return null;
     }
index 1df4ee52618c0c6f4ad69216396c9c7f3e9b7656..4a7c4c2c490cf7e729676f5cdc21ce20fa7a8681 100644 (file)
@@ -25,6 +25,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.link
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelId;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 
@@ -58,8 +60,8 @@ public abstract class AbstractTeLspNlriCodec extends AbstractNlriTypeCodec {
 
     public static TeLspCase serializeTeLsp(final ChoiceNode objectType) {
         final TeLspCaseBuilder teLsp = new TeLspCaseBuilder();
-        teLsp.setLspId(new LspId((Long) objectType.getChild(LSP_ID).get().getValue()));
-        teLsp.setTunnelId(new TunnelId((Integer) objectType.getChild(TUNNEL_ID).get().getValue()));
+        teLsp.setLspId(new LspId((Uint32) objectType.getChild(LSP_ID).get().getValue()));
+        teLsp.setTunnelId(new TunnelId((Uint16) objectType.getChild(TUNNEL_ID).get().getValue()));
         final ChoiceNode addressFamily = (ChoiceNode) objectType.getChild(ADDRESS_FAMILY).get();
         teLsp.setAddressFamily(serializeAddressFamily(addressFamily,
             addressFamily.getChild(IPV4_TUNNEL_SENDER_ADDRESS).isPresent()));
index 5214a09bfbcbeca38d2c43c007bedac03e541cab..90206d128a037f8824cffdcbe2351e9b77d2d5c2 100644 (file)
@@ -76,6 +76,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.IsoSystemIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelId;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
 import org.opendaylight.yangtools.yang.common.Uint8;
@@ -407,9 +408,9 @@ public class LinkstateNlriParserTest {
         ipv4NeighborAddress.withNodeIdentifier(LinkNlriParser.IPV4_NEIGHBOR_NID);
         ipv4NeighborAddress.withValue("197.20.160.40");
 
-        final ImmutableLeafNodeBuilder<Integer> multiTopologyId = new ImmutableLeafNodeBuilder<>();
+        final ImmutableLeafNodeBuilder<Uint16> multiTopologyId = new ImmutableLeafNodeBuilder<>();
         multiTopologyId.withNodeIdentifier(TlvUtil.MULTI_TOPOLOGY_NID);
-        multiTopologyId.withValue(3);
+        multiTopologyId.withValue(Uint16.valueOf(3));
 
         linkDescriptors.addChild(linkLocalIdentifier.build());
         linkDescriptors.addChild(linkRemoteIdentifier.build());
@@ -507,9 +508,9 @@ public class LinkstateNlriParserTest {
         prefixDescriptors.addChild(asNumber.build());
         prefixDescriptors.addChild(domainID.build());
 
-        final ImmutableLeafNodeBuilder<Integer> multiTopologyId = new ImmutableLeafNodeBuilder<>();
+        final ImmutableLeafNodeBuilder<Uint16> multiTopologyId = new ImmutableLeafNodeBuilder<>();
         multiTopologyId.withNodeIdentifier(TlvUtil.MULTI_TOPOLOGY_NID);
-        multiTopologyId.withValue(15);
+        multiTopologyId.withValue(Uint16.valueOf(15));
 
         prefixDescriptors.addChild(multiTopologyId.build());
 
@@ -564,13 +565,13 @@ public class LinkstateNlriParserTest {
         final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> objectType = Builders.choiceBuilder();
         objectType.withNodeIdentifier(LinkstateNlriParser.OBJECT_TYPE_NID);
 
-        final ImmutableLeafNodeBuilder<Long> lspId = new ImmutableLeafNodeBuilder<>();
+        final ImmutableLeafNodeBuilder<Uint32> lspId = new ImmutableLeafNodeBuilder<>();
         lspId.withNodeIdentifier(AbstractTeLspNlriCodec.LSP_ID);
-        lspId.withValue(1L);
+        lspId.withValue(Uint32.ONE);
 
-        final ImmutableLeafNodeBuilder<Integer> tunnelId = new ImmutableLeafNodeBuilder<>();
+        final ImmutableLeafNodeBuilder<Uint16> tunnelId = new ImmutableLeafNodeBuilder<>();
         tunnelId.withNodeIdentifier(AbstractTeLspNlriCodec.TUNNEL_ID);
-        tunnelId.withValue(1);
+        tunnelId.withValue(Uint16.ONE);
 
         final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> addressFamily = Builders.choiceBuilder();
         addressFamily.withNodeIdentifier(AbstractTeLspNlriCodec.ADDRESS_FAMILY);
index 6d22f2d3e32ff3b746030728316e46a3858243a7..e0991bcc886783d29a8057731b2e1df977d56d73 100644 (file)
@@ -13,6 +13,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.Open;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.BgpParameters;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.bgp.parameters.OptionalCapabilities;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -56,7 +57,7 @@ public final class AsNumberUtil {
     public static AsNumber extractAS(final DataContainerNode<?> dtc, final NodeIdentifier nid) {
         final NormalizedNode<?, ?> as = NormalizedNodes.findNode(dtc, nid).orElse(null);
         if (as != null) {
-            return new AsNumber((Long) as.getValue());
+            return new AsNumber((Uint32) as.getValue());
         }
         return null;
     }
index a3e4dcf6830980ad462bf35424286f179cd01c05..7875a20cbdf6151ce31e5d6706c250b166727e21 100644 (file)
@@ -43,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -211,7 +212,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
     private PathId extractPathId(final MapEntryNode ipv4Route) {
         final Optional<DataContainerChild<? extends PathArgument, ?>> pathId = ipv4Route
                 .getChild(this.routeKeyPathIdLeaf);
-        return pathId.map(dataContainerChild -> new PathId((Long) dataContainerChild.getValue())).orElse(null);
+        return pathId.map(dataContainerChild -> new PathId((Uint32) dataContainerChild.getValue())).orElse(null);
     }
 
     public void close() {