Fix enable checkstyle in bgp-flowspec 40/80840/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 11:25:22 +0000 (12:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 14:44:09 +0000 (15:44 +0100)
This fixes the violations and flips the switch on.

JIRA: BGPCEP-713
Change-Id: Ia1125469441ea17a8185976bf8a0cd2efab47822
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
38 files changed:
bgp/extensions/flowspec/pom.xml
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BGPActivator.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecActivator.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecExtensionProviderContext.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/RedirectAsFourOctetEcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/RedirectAsTwoOctetEcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/RedirectIpv4EcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/RedirectIpv6EcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/TrafficActionEcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/TrafficMarkingEcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/TrafficRateEcHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericByteOperandParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericOperandParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractOperandParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv4DestinationPrefixHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv4FragmentHandler.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv6DestinationPrefixHandler.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/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnNlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnRIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv4/FlowspecL3vpnIpv4NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv4/FlowspecL3vpnIpv4RIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv6/FlowspecL3vpnIpv6NlriParser.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/ActivatorTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.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/FlowspecL3vpnIpv4RIBSupportTest.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/SimpleFlowspecIpv6NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/TableTypeActivatorTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/FSExtendedCommunitiesTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericOperandParserTest.java

index a15e2c6909ecfff3a1a7c77edeb8f41f5c6d856b..c00763f1fd98e2aabd1a0f20e01c79d18c4b3d27 100644 (file)
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <configuration>
-                    <violationSeverity>warn</violationSeverity>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <scm>
         <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
index 002ae71fcdcf36e5f23e792f519ad5f10e862bf4..25f99c21ba760113a582f615ca7a385aed774b98 100644 (file)
@@ -63,72 +63,84 @@ public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
         final SimpleFlowspecExtensionProviderContext flowspecContext = this.activator.getContext();
 
         regs.add(context.registerSubsequentAddressFamily(FlowspecSubsequentAddressFamily.class, FLOWSPEC_SAFI));
-        regs.add(context.registerSubsequentAddressFamily(FlowspecL3vpnSubsequentAddressFamily.class, FLOWSPEC_L3VPN_SAFI));
+        regs.add(context.registerSubsequentAddressFamily(FlowspecL3vpnSubsequentAddressFamily.class,
+            FLOWSPEC_L3VPN_SAFI));
 
         final Ipv4NextHopParserSerializer ipv4NextHopParser = new Ipv4NextHopParserSerializer();
         final Ipv6NextHopParserSerializer ipv6NextHopParser = new Ipv6NextHopParserSerializer();
 
-        final SimpleFlowspecIpv4NlriParser fsIpv4Handler = new SimpleFlowspecIpv4NlriParser(flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
-        final SimpleFlowspecIpv6NlriParser fsIpv6Handler = new SimpleFlowspecIpv6NlriParser(flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
-        regs.add(
-                context.registerNlriParser(
-                        Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class, fsIpv4Handler, ipv4NextHopParser, Ipv4NextHopCase.class
-                        )
-                );
-        regs.add(
-                context.registerNlriParser(
-                        Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class, fsIpv6Handler, ipv6NextHopParser, Ipv6NextHopCase.class
-                        )
-                );
+        final SimpleFlowspecIpv4NlriParser fsIpv4Handler = new SimpleFlowspecIpv4NlriParser(
+            flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
+        final SimpleFlowspecIpv6NlriParser fsIpv6Handler = new SimpleFlowspecIpv6NlriParser(
+            flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
+        regs.add(context.registerNlriParser(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class,
+            fsIpv4Handler, ipv4NextHopParser, Ipv4NextHopCase.class));
+        regs.add(context.registerNlriParser(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class,
+            fsIpv6Handler, ipv6NextHopParser, Ipv6NextHopCase.class));
         regs.add(context.registerNlriSerializer(FlowspecRoutes.class, fsIpv4Handler));
         regs.add(context.registerNlriSerializer(FlowspecIpv6Routes.class, fsIpv6Handler));
 
-        final FlowspecL3vpnIpv4NlriParser fsL3vpnIpv4Handler = new FlowspecL3vpnIpv4NlriParser(flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
-        final FlowspecL3vpnIpv6NlriParser fsL3vpnIpv6Handler = new FlowspecL3vpnIpv6NlriParser(flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
-        regs.add(
-                context.registerNlriParser(
-                        Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class, fsL3vpnIpv4Handler, ipv4NextHopParser, Ipv4NextHopCase.class
-                        )
-                );
-        regs.add(
-                context.registerNlriParser(
-                        Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class, fsL3vpnIpv6Handler, ipv6NextHopParser, Ipv6NextHopCase.class
-                        )
-                );
+        final FlowspecL3vpnIpv4NlriParser fsL3vpnIpv4Handler = new FlowspecL3vpnIpv4NlriParser(
+            flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        final FlowspecL3vpnIpv6NlriParser fsL3vpnIpv6Handler = new FlowspecL3vpnIpv6NlriParser(
+            flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        regs.add(context.registerNlriParser(Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
+            fsL3vpnIpv4Handler, ipv4NextHopParser, Ipv4NextHopCase.class));
+        regs.add(context.registerNlriParser(Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
+            fsL3vpnIpv6Handler, ipv6NextHopParser, Ipv6NextHopCase.class));
         regs.add(context.registerNlriSerializer(FlowspecL3vpnIpv4Routes.class, fsL3vpnIpv4Handler));
         regs.add(context.registerNlriSerializer(FlowspecL3vpnIpv6Routes.class, fsL3vpnIpv6Handler));
 
         final RedirectAsTwoOctetEcHandler redirect2bHandler = new RedirectAsTwoOctetEcHandler();
-        regs.add(context.registerExtendedCommunityParser(redirect2bHandler.getType(true), redirect2bHandler.getSubType(), redirect2bHandler));
+        regs.add(context.registerExtendedCommunityParser(redirect2bHandler.getType(true),
+            redirect2bHandler.getSubType(), redirect2bHandler));
         regs.add(context.registerExtendedCommunitySerializer(RedirectExtendedCommunityCase.class, redirect2bHandler));
 
         final TrafficActionEcHandler trafficActionHandler = new TrafficActionEcHandler();
-        regs.add(context.registerExtendedCommunityParser(trafficActionHandler.getType(true), trafficActionHandler.getSubType(), trafficActionHandler));
-        regs.add(context.registerExtendedCommunitySerializer(TrafficActionExtendedCommunityCase.class, trafficActionHandler));
+        regs.add(context.registerExtendedCommunityParser(trafficActionHandler.getType(true),
+            trafficActionHandler.getSubType(), trafficActionHandler));
+        regs.add(context.registerExtendedCommunitySerializer(TrafficActionExtendedCommunityCase.class,
+            trafficActionHandler));
 
         final TrafficMarkingEcHandler trafficMarkingHandler = new TrafficMarkingEcHandler();
-        regs.add(context.registerExtendedCommunityParser(trafficMarkingHandler.getType(true), trafficMarkingHandler.getSubType(), trafficMarkingHandler));
-        regs.add(context.registerExtendedCommunitySerializer(TrafficMarkingExtendedCommunityCase.class, trafficMarkingHandler));
+        regs.add(context.registerExtendedCommunityParser(trafficMarkingHandler.getType(true),
+            trafficMarkingHandler.getSubType(), trafficMarkingHandler));
+        regs.add(context.registerExtendedCommunitySerializer(TrafficMarkingExtendedCommunityCase.class,
+            trafficMarkingHandler));
 
         final TrafficRateEcHandler trafficRateEcHandler = new TrafficRateEcHandler();
-        regs.add(context.registerExtendedCommunityParser(trafficRateEcHandler.getType(true), trafficRateEcHandler.getSubType(), trafficRateEcHandler));
-        regs.add(context.registerExtendedCommunitySerializer(TrafficRateExtendedCommunityCase.class, trafficRateEcHandler));
+        regs.add(context.registerExtendedCommunityParser(trafficRateEcHandler.getType(true),
+            trafficRateEcHandler.getSubType(), trafficRateEcHandler));
+        regs.add(context.registerExtendedCommunitySerializer(TrafficRateExtendedCommunityCase.class,
+            trafficRateEcHandler));
 
         final RedirectIpv6EcHandler redirectIpv6EcHandler = new RedirectIpv6EcHandler();
-        regs.add(context.registerExtendedCommunityParser(redirectIpv6EcHandler.getType(true), redirectIpv6EcHandler.getSubType(), redirectIpv6EcHandler));
-        regs.add(context.registerExtendedCommunitySerializer(RedirectIpv6ExtendedCommunityCase.class, redirectIpv6EcHandler));
+        regs.add(context.registerExtendedCommunityParser(redirectIpv6EcHandler.getType(true),
+            redirectIpv6EcHandler.getSubType(), redirectIpv6EcHandler));
+        regs.add(context.registerExtendedCommunitySerializer(RedirectIpv6ExtendedCommunityCase.class,
+            redirectIpv6EcHandler));
 
         final RedirectAsFourOctetEcHandler redirect4bHandler = new RedirectAsFourOctetEcHandler();
-        regs.add(context.registerExtendedCommunityParser(redirect4bHandler.getType(true), redirect4bHandler.getSubType(), redirect4bHandler));
-        regs.add(context.registerExtendedCommunitySerializer(RedirectAs4ExtendedCommunityCase.class, redirect4bHandler));
+        regs.add(context.registerExtendedCommunityParser(redirect4bHandler.getType(true),
+            redirect4bHandler.getSubType(), redirect4bHandler));
+        regs.add(context.registerExtendedCommunitySerializer(RedirectAs4ExtendedCommunityCase.class,
+            redirect4bHandler));
 
         final RedirectIpv4EcHandler redirectIpv4Handler = new RedirectIpv4EcHandler();
-        regs.add(context.registerExtendedCommunityParser(redirectIpv4Handler.getType(true), redirectIpv4Handler.getSubType(), redirectIpv4Handler));
-        regs.add(context.registerExtendedCommunitySerializer(RedirectIpv4ExtendedCommunityCase.class, redirectIpv4Handler));
+        regs.add(context.registerExtendedCommunityParser(redirectIpv4Handler.getType(true),
+            redirectIpv4Handler.getSubType(), redirectIpv4Handler));
+        regs.add(context.registerExtendedCommunitySerializer(RedirectIpv4ExtendedCommunityCase.class,
+            redirectIpv4Handler));
 
         final RedirectIpNextHopEcHandler redirectIpNhHandler = new RedirectIpNextHopEcHandler();
-        regs.add(context.registerExtendedCommunityParser(redirectIpNhHandler.getType(true), redirectIpNhHandler.getSubType(), redirectIpNhHandler));
-        regs.add(context.registerExtendedCommunitySerializer(RedirectIpNhExtendedCommunityCase.class, redirectIpNhHandler));
+        regs.add(context.registerExtendedCommunityParser(redirectIpNhHandler.getType(true),
+            redirectIpNhHandler.getSubType(), redirectIpNhHandler));
+        regs.add(context.registerExtendedCommunitySerializer(RedirectIpNhExtendedCommunityCase.class,
+            redirectIpNhHandler));
 
         return regs;
     }
index efe1a83a1450ebc4083c0f5109e9029c4d2c2743..75ef962e0a947690ee1a3e216f6e593bf240b39e 100644 (file)
@@ -149,7 +149,8 @@ public final class FlowspecActivator implements AutoCloseable {
         final FSIpv4FragmentHandler fragmentHandler = new FSIpv4FragmentHandler();
         this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeParser(FSIpv4FragmentHandler.FRAGMENT_VALUE,
             fragmentHandler));
-        this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeSerializer(FragmentCase.class, fragmentHandler));
+        this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeSerializer(FragmentCase.class,
+            fragmentHandler));
     }
 
     private void registerIpv6FlowspecTypeHandlers(
@@ -173,7 +174,8 @@ public final class FlowspecActivator implements AutoCloseable {
         final FSIpv6NextHeaderHandler nextHeaderHandler = new FSIpv6NextHeaderHandler();
         this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeParser(
             FSIpv6NextHeaderHandler.NEXT_HEADER_VALUE, nextHeaderHandler));
-        this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeSerializer(NextHeaderCase.class, nextHeaderHandler));
+        this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeSerializer(NextHeaderCase.class,
+            nextHeaderHandler));
 
         final FSIpv6FragmentHandler fragmentHandler = new FSIpv6FragmentHandler();
         this.registrations.add(flowspecTypeRegistry.registerFlowspecTypeParser(FSIpv6FragmentHandler.FRAGMENT_VALUE,
index 64051fa0a18f587291c03bfadbbceb6e453994eb..2bc882c376b7fe509255824ffa234a2ce0a9cd5a 100644 (file)
@@ -57,7 +57,7 @@ public final class FlowspecIpv4RIBSupport
     static synchronized FlowspecIpv4RIBSupport getInstance(
             final SimpleFlowspecExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        if (SINGLETON == null){
+        if (SINGLETON == null) {
             SINGLETON = new FlowspecIpv4RIBSupport(context, mappingService);
         }
         return SINGLETON;
index e26da225c7be7dcac2c6d98b4a2139e88b1483eb..76e8edbb2507abac9d655b0e0e02d0432095ef96 100644 (file)
@@ -14,8 +14,8 @@ public class SimpleFlowspecExtensionProviderContext {
 
         public final int index;
 
-        AFI(int i) {
-            this.index = i;
+        AFI(int index) {
+            this.index = index;
         }
     }
 
@@ -25,12 +25,12 @@ public class SimpleFlowspecExtensionProviderContext {
 
         public final int index;
 
-        SAFI(int i) {
-            this.index = i;
+        SAFI(int index) {
+            this.index = index;
         }
     }
 
-    private final SimpleFlowspecTypeRegistry flowspecTypeRegistries[][] = new SimpleFlowspecTypeRegistry[2][2];
+    private final SimpleFlowspecTypeRegistry[][] flowspecTypeRegistries = new SimpleFlowspecTypeRegistry[2][2];
 
     public SimpleFlowspecExtensionProviderContext() {
         for (AFI afi : AFI.values()) {
index b7051f3737720b87cd1d02cdb5b9a90c5aea9620..cea0ee7402375e65c6579239332a5f1925562ae7 100644 (file)
@@ -28,9 +28,11 @@ public final class SimpleFlowspecIpv4NlriParser extends AbstractFlowspecNlriPars
     }
 
     @Override
-    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[0];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCaseBuilder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCaseBuilder()
             .setDestinationFlowspecIpv4(
                 new DestinationFlowspecIpv4Builder()
                     .setFlowspec(flowspecList)
@@ -40,22 +42,24 @@ public final class SimpleFlowspecIpv4NlriParser extends AbstractFlowspecNlriPars
     }
 
     @Override
-    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[0];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecCaseBuilder()
-            .setDestinationFlowspecIpv4(
-                new DestinationFlowspecIpv4Builder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecCaseBuilder()
+                .setDestinationFlowspecIpv4(new DestinationFlowspecIpv4Builder()
                     .setFlowspec(flowspecList)
                     .setPathId(pathId)
-                    .build()
-            ).build();
+                    .build()).build();
     }
 
     @Override
     protected void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecCase) {
-            final DestinationFlowspecIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecCase) dstType)
-                .getDestinationFlowspecIpv4();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecCase) {
+            final DestinationFlowspecIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                    .yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                    .DestinationFlowspecCase) dstType).getDestinationFlowspecIpv4();
             serializeNlri(new Object[] {destFlowspec.getFlowspec()}, destFlowspec.getPathId(), byteAggregator);
         }
     }
@@ -72,9 +76,11 @@ public final class SimpleFlowspecIpv4NlriParser extends AbstractFlowspecNlriPars
 
     @Override
     protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase) {
-            final DestinationFlowspecIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase) dstType)
-                .getDestinationFlowspecIpv4();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase) {
+            final DestinationFlowspecIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                    .yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .DestinationFlowspecCase) dstType).getDestinationFlowspecIpv4();
             serializeNlri(new Object[] {destFlowspec.getFlowspec()}, destFlowspec.getPathId(), byteAggregator);
         }
     }
index d7c0f747854384f4f515ae32fd924cdfdde25ae5..d15e3f8188fff477881ba1cf3cba15ade18e70a7 100644 (file)
@@ -28,9 +28,11 @@ public final class SimpleFlowspecIpv6NlriParser extends AbstractFlowspecNlriPars
     }
 
     @Override
-    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[0];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
             .setDestinationFlowspecIpv6(
                 new DestinationFlowspecIpv6Builder()
                     .setFlowspec(flowspecList)
@@ -40,9 +42,11 @@ public final class SimpleFlowspecIpv6NlriParser extends AbstractFlowspecNlriPars
     }
 
     @Override
-    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[0];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
             .setDestinationFlowspecIpv6(
                 new DestinationFlowspecIpv6Builder()
                     .setFlowspec(flowspecList)
@@ -63,18 +67,22 @@ public final class SimpleFlowspecIpv6NlriParser extends AbstractFlowspecNlriPars
 
     @Override
     protected void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6Case) {
-            final DestinationFlowspecIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6Case) dstType)
-                .getDestinationFlowspecIpv6();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6Case) {
+            final DestinationFlowspecIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                    .yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                    .DestinationFlowspecIpv6Case) dstType).getDestinationFlowspecIpv6();
             serializeNlri(new Object[] {destFlowspec.getFlowspec()}, destFlowspec.getPathId(), byteAggregator);
         }
     }
 
     @Override
     protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6Case) {
-            final DestinationFlowspecIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6Case) dstType)
-                .getDestinationFlowspecIpv6();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6Case) {
+            final DestinationFlowspecIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                    .yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .DestinationFlowspecIpv6Case) dstType).getDestinationFlowspecIpv6();
             serializeNlri(new Object[] {destFlowspec.getFlowspec()}, destFlowspec.getPathId(), byteAggregator);
         }
     }
index f8125f05b4d7870d3ce8b38d9583b88ccdf54c4e..5890b2bb7eea1db1632946ff9a32cc310518affb 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -29,15 +27,17 @@ public final class RedirectAsFourOctetEcHandler implements ExtendedCommunityPars
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectAs4ExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.RedirectAs4ExtendedCommunity,
                 "The extended community %s is not RedirectAs4ExtendedCommunityCase type.", extendedCommunity);
-        final RedirectAs4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectAs4ExtendedCommunity) extendedCommunity).getRedirectAs4();
+        final RedirectAs4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.RedirectAs4ExtendedCommunity) extendedCommunity).getRedirectAs4();
         ByteBufWriteUtil.writeUnsignedInt(redirect.getGlobalAdministrator().getValue(), byteAggregator);
         ByteBufWriteUtil.writeUnsignedShort(redirect.getLocalAdministrator(), byteAggregator);
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         final RedirectAs4Builder builder = new RedirectAs4Builder();
         builder.setGlobalAdministrator(new AsNumber(buffer.readUnsignedInt()));
         builder.setLocalAdministrator(buffer.readUnsignedShort());
@@ -53,5 +53,4 @@ public final class RedirectAsFourOctetEcHandler implements ExtendedCommunityPars
     public int getSubType() {
         return SUBTYPE;
     }
-
 }
index c331ca56c210d9415dfcd13a6a5f4c8723859d03..7abd7f897434156ae73b8610966e0de3cc12da4a 100644 (file)
@@ -8,10 +8,9 @@
 
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteArray;
@@ -32,9 +31,11 @@ public class RedirectAsTwoOctetEcHandler implements ExtendedCommunityParser, Ext
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.RedirectExtendedCommunity,
                 "The extended community %s is not RedirectExtendedCommunityCase type.", extendedCommunity);
-        final RedirectExtendedCommunity redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectExtendedCommunity) extendedCommunity).getRedirectExtendedCommunity();
+        final RedirectExtendedCommunity redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                .bgp.flowspec.rev180329.RedirectExtendedCommunity) extendedCommunity).getRedirectExtendedCommunity();
         ByteBufWriteUtil.writeUnsignedShort(redirect.getGlobalAdministrator().getValue().intValue(), byteAggregator);
         byteAggregator.writeBytes(redirect.getLocalAdministrator());
     }
@@ -51,7 +52,7 @@ public class RedirectAsTwoOctetEcHandler implements ExtendedCommunityParser, Ext
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         final ShortAsNumber as1 = new ShortAsNumber((long) buffer.readUnsignedShort());
         final byte[] byteValue = ByteArray.readBytes(buffer, TRAFFIC_RATE_SIZE);
         return new RedirectExtendedCommunityCaseBuilder().setRedirectExtendedCommunity(
index ca4a50e491022f38fbaed935e0dc8c04cf6725b8..ecafdaf9a7fe2a98139c21688da4d3939a548f66 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -29,15 +27,17 @@ public class RedirectIpv4EcHandler implements ExtendedCommunityParser, ExtendedC
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectIpv4ExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.RedirectIpv4ExtendedCommunity,
                 "The extended community %s is not RedirectIpv4ExtendedCommunityCase type.", extendedCommunity);
-        final RedirectIpv4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.RedirectIpv4ExtendedCommunity) extendedCommunity).getRedirectIpv4();
+        final RedirectIpv4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.RedirectIpv4ExtendedCommunity) extendedCommunity).getRedirectIpv4();
         ByteBufWriteUtil.writeIpv4Address(redirect.getGlobalAdministrator(), byteAggregator);
         ByteBufWriteUtil.writeUnsignedShort(redirect.getLocalAdministrator(), byteAggregator);
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         final RedirectIpv4Builder builder = new RedirectIpv4Builder();
         builder.setGlobalAdministrator(Ipv4Util.addressForByteBuf(buffer));
         builder.setLocalAdministrator(buffer.readUnsignedShort());
@@ -53,5 +53,4 @@ public class RedirectIpv4EcHandler implements ExtendedCommunityParser, ExtendedC
     public int getSubType() {
         return SUBTYPE;
     }
-
 }
index 541ea5c34eba84d301fc7bf1fd5e110366159863..e36ae75aaae5fed123d11407ee55b96d0c2301aa 100644 (file)
@@ -9,8 +9,6 @@ package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -47,7 +45,7 @@ public final class RedirectIpv6EcHandler implements ExtendedCommunityParser, Ext
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         return new RedirectIpv6ExtendedCommunityCaseBuilder().setRedirectIpv6(
                 new RedirectIpv6Builder()
                     .setGlobalAdministrator(Ipv6Util.addressForByteBuf(buffer))
index 7dcfe38f281e197b9104d9d161d4ed6788bda2c6..35baa34f2377f8971e8601c4928667fb27d62bda 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.BitArray;
@@ -36,9 +34,12 @@ public class TrafficActionEcHandler implements ExtendedCommunityParser, Extended
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficActionExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.TrafficActionExtendedCommunity,
                 "The extended community %s is not TrafficActionExtendedCommunityCase type.", extendedCommunity);
-        final TrafficActionExtendedCommunity trafficAction = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficActionExtendedCommunity) extendedCommunity).getTrafficActionExtendedCommunity();
+        final TrafficActionExtendedCommunity trafficAction = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
+                .ns.yang.bgp.flowspec.rev180329.TrafficActionExtendedCommunity) extendedCommunity)
+                .getTrafficActionExtendedCommunity();
         byteAggregator.writeZero(RESERVED);
         final BitArray flags = new BitArray(FLAGS_SIZE);
         flags.set(SAMPLE_BIT, trafficAction.isSample());
@@ -58,7 +59,7 @@ public class TrafficActionEcHandler implements ExtendedCommunityParser, Extended
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         buffer.skipBytes(RESERVED);
         final BitArray flags = BitArray.valueOf(buffer, FLAGS_SIZE);
         final boolean sample = flags.get(SAMPLE_BIT);
@@ -69,5 +70,4 @@ public class TrafficActionEcHandler implements ExtendedCommunityParser, Extended
                     .setTerminalAction(terminal)
                     .build()).build();
     }
-
 }
index 5ed846895bc5e5c6c0a72a9595bdfc772545258f..b1d3c1e57a0b0ab2340e817ed12362a0a3afed97 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -31,9 +29,12 @@ public class TrafficMarkingEcHandler implements ExtendedCommunityParser, Extende
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficMarkingExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.TrafficMarkingExtendedCommunity,
                 "The extended community %s is not TrafficMarkingExtendedCommunity type.", extendedCommunity);
-        final TrafficMarkingExtendedCommunity trafficMarking = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficMarkingExtendedCommunity) extendedCommunity).getTrafficMarkingExtendedCommunity();
+        final TrafficMarkingExtendedCommunity trafficMarking = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params
+                .xml.ns.yang.bgp.flowspec.rev180329.TrafficMarkingExtendedCommunity) extendedCommunity)
+                .getTrafficMarkingExtendedCommunity();
         byteAggregator.writeZero(RESERVED);
         ByteBufWriteUtil.writeUnsignedByte(trafficMarking.getGlobalAdministrator().getValue(), byteAggregator);
     }
@@ -50,12 +51,11 @@ public class TrafficMarkingEcHandler implements ExtendedCommunityParser, Extende
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         buffer.skipBytes(RESERVED);
         final Dscp dscp = new Dscp(buffer.readUnsignedByte());
         return new TrafficMarkingExtendedCommunityCaseBuilder().setTrafficMarkingExtendedCommunity(
                 new TrafficMarkingExtendedCommunityBuilder()
                     .setGlobalAdministrator(dscp).build()).build();
     }
-
 }
index 2bb55192b517c0c2582608009f7e6120e48975cc..98fcf7428aac09ae11f78cf007332f74f555ef64 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec.extended.communities;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
-import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunitySerializer;
 import org.opendaylight.protocol.util.ByteArray;
@@ -33,9 +31,12 @@ public class TrafficRateEcHandler implements ExtendedCommunityParser, ExtendedCo
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficRateExtendedCommunity,
+        checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            .flowspec.rev180329.TrafficRateExtendedCommunity,
                 "The extended community %s is not TrafficRateExtendedCommunity type.", extendedCommunity);
-        final TrafficRateExtendedCommunity trafficRate = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.TrafficRateExtendedCommunity) extendedCommunity).getTrafficRateExtendedCommunity();
+        final TrafficRateExtendedCommunity trafficRate = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.TrafficRateExtendedCommunity) extendedCommunity)
+                .getTrafficRateExtendedCommunity();
         ByteBufWriteUtil.writeShort(trafficRate.getInformativeAs().getValue().shortValue(), byteAggregator);
         byteAggregator.writeBytes(trafficRate.getLocalAdministrator().getValue());
     }
@@ -52,7 +53,7 @@ public class TrafficRateEcHandler implements ExtendedCommunityParser, ExtendedCo
     }
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
         final ShortAsNumber as = new ShortAsNumber((long) buffer.readUnsignedShort());
         final Bandwidth value = new Bandwidth(ByteArray.readBytes(buffer, TRAFFIC_RATE_SIZE));
         return new TrafficRateExtendedCommunityCaseBuilder().setTrafficRateExtendedCommunity(
index cd152bc6590a1705befd5407caad5fa28721993d..69ffe5066c0e8fff486421dfd86cc478e0cf6f24 100644 (file)
@@ -29,8 +29,9 @@ public abstract class AbstractFSFragmentHandler implements FlowspecTypeParser, F
     static final int IS_A_FRAGMENT = 6;
     static final int DONT_FRAGMENT = 7;
 
-    protected abstract Fragment parseFragment(final byte fragment);
-    protected abstract byte serializeFragment(final Fragment fragment);
+    protected abstract Fragment parseFragment(byte fragment);
+
+    protected abstract byte serializeFragment(Fragment fragment);
 
     @Override
     public void serializeType(final FlowspecType fsType, final ByteBuf output) {
index 946da42dead8cd6e21d0b5e36a16834cf4ade812..3e4b7995c1ecbc1486cc974ad6238dd27abf7a01 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.NumericOperand;
 
 /**
@@ -33,7 +32,7 @@ abstract class AbstractNumericByteOperandParser<N, V extends Number> extends Abs
         return buffer.toString();
     }
 
-    abstract <T extends N> V getValue(final T item);
+    abstract <T extends N> V getValue(T item);
 
-    abstract <T extends N> NumericOperand getOp(final T item);
+    abstract <T extends N> NumericOperand getOp(T item);
 }
\ No newline at end of file
index a58526b43fec2f8d467a1e79610fc93edc1b5420..7f8992014d6972115ec9eb4921d66ca18448d380 100644 (file)
@@ -32,16 +32,6 @@ public abstract class AbstractNumericOperandParser<N> extends AbstractOperandPar
     private static final int GREATER_THAN = 6;
     private static final int EQUAL = 7;
 
-    /**
-     * Serializes specific numeric operand type depending on the length field value.
-     *
-     * @param list of operands to be serialized
-     * @param nlriByteBuf where the operands will be serialized
-     */
-    protected abstract <T extends N> void serialize(final List<T> list, final ByteBuf nlriByteBuf);
-
-    protected abstract <T extends N> String toString(final List<T> list);
-
     @Override
     public final NumericOperand create(final Set<String> operandValues) {
         return new NumericOperand(
@@ -66,6 +56,14 @@ public abstract class AbstractNumericOperandParser<N> extends AbstractOperandPar
         buffer.writeByte(operandValues.toByte() | byteLength);
     }
 
+    /**
+     * Serializes specific numeric operand type depending on the length field value.
+     *
+     * @param list of operands to be serialized
+     * @param nlriByteBuf where the operands will be serialized
+     */
+    protected abstract <T extends N> void serialize(List<T> list, ByteBuf nlriByteBuf);
+
     @Override
     public final NumericOperand parse(final byte operand) {
         final BitArray operandValues = BitArray.valueOf(operand);
@@ -105,4 +103,6 @@ public abstract class AbstractNumericOperandParser<N> extends AbstractOperandPar
         }
         return buffer.toString();
     }
+
+    protected abstract <T extends N> String toString(List<T> list);
 }
index 7e5d01844a8800453e89635c62b480ab82326924..7db6a88600e564f731ac80ff6ff577443c5ef5d3 100644 (file)
@@ -43,7 +43,7 @@ public abstract class AbstractOperandParser<T> {
      * @param opValues set of operand values
      * @return specific type of operand
      */
-    protected abstract T create(final Set<String> opValues);
+    protected abstract T create(Set<String> opValues);
 
     /**
      * Serializes operand to bytes.
@@ -53,8 +53,7 @@ public abstract class AbstractOperandParser<T> {
      * @param endOfList if this operand is at the end of the list
      * @param buffer where the operand will be serialized to
      */
-    protected abstract void serialize(final T op, final int length, final boolean endOfList,
-            final ByteBuf buffer);
+    protected abstract void serialize(T op, int length, boolean endOfList, ByteBuf buffer);
 
     /**
      * Parses operand from byte value.
@@ -62,7 +61,7 @@ public abstract class AbstractOperandParser<T> {
      * @param op byte representation of an operand
      * @return operand object
      */
-    protected abstract T parse(final byte op);
+    protected abstract T parse(byte op);
 
     /**
      * Creates a string representation of the operand.
@@ -72,5 +71,5 @@ public abstract class AbstractOperandParser<T> {
      * @param isFirst true if this operand is the first in list of operands
      * @return String representation of the operand
      */
-    protected abstract String toString(final T op, final boolean isFirst);
+    protected abstract String toString(T op, boolean isFirst);
 }
index 868f1621487ac921d7f29b57b3dc89146b44a81c..f12849d14511a746dff2e5bfd693e0eb66c83d85 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.protocol.util.Ipv4Util;
@@ -22,7 +22,7 @@ public final class FSIpv4DestinationPrefixHandler implements FlowspecTypeParser,
 
     @Override
     public void serializeType(final FlowspecType value, final ByteBuf output) {
-        Preconditions.checkArgument(value instanceof DestinationPrefixCase, "DestinationPrefixCase class is mandatory!");
+        checkArgument(value instanceof DestinationPrefixCase, "DestinationPrefixCase class is mandatory!");
         output.writeByte(DESTINATION_PREFIX_VALUE);
         ByteBufWriteUtil.writeMinimalPrefix(((DestinationPrefixCase) value).getDestinationPrefix(), output);
     }
index 88b4b86c149eeb895aa8818346937593ec4896d5..4ae295d08656ff753e25040058f0db2806855b32 100644 (file)
@@ -15,7 +15,8 @@ public class FSIpv4FragmentHandler extends AbstractFSFragmentHandler {
     @Override
     protected final Fragment parseFragment(final byte fragment) {
         final BitArray bs = BitArray.valueOf(fragment);
-        return new Fragment(bs.get(DONT_FRAGMENT), bs.get(FIRST_FRAGMENT), bs.get(IS_A_FRAGMENT), bs.get(LAST_FRAGMENT));
+        return new Fragment(bs.get(DONT_FRAGMENT), bs.get(FIRST_FRAGMENT), bs.get(IS_A_FRAGMENT),
+            bs.get(LAST_FRAGMENT));
     }
 
     @Override
index 426bbe00908af3b59d0ecdf60ad6e7ec98cd9ad9..4dea615fcb3eca562ae1872215055a0665684ce4 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.DestinationIpv6PrefixCase;
@@ -20,7 +20,7 @@ public final class FSIpv6DestinationPrefixHandler implements FlowspecTypeParser,
 
     @Override
     public void serializeType(final FlowspecType value, final ByteBuf output) {
-        Preconditions.checkArgument(value instanceof DestinationIpv6PrefixCase, "DestinationIpv6PrefixCase class is mandatory!");
+        checkArgument(value instanceof DestinationIpv6PrefixCase, "DestinationIpv6PrefixCase class is mandatory!");
         output.writeByte(IPV6_DESTINATION_PREFIX_VALUE);
 
         FSIpv6SourcePrefixHandler.writePrefix(((DestinationIpv6PrefixCase) value).getDestinationPrefix(), output);
index 4f6ccf0cc39a16f11b48a5042e8506e20b9f5b0c..7ea88523044a786229b2bfafa85b597d7887edd5 100644 (file)
@@ -32,6 +32,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 
 /**
+ * Helper for parsing IPv4 Flowspec.
+ *
  * @author Kevin Wang
  */
 public final class FlowspecIpv4NlriParserHelper {
index 66a6a46695113b0c56ed97b63dfc37b7ceb5cbea..3640976a843dc50bfd172c3d8da2822693c62260 100644 (file)
@@ -87,8 +87,8 @@ public final class FlowspecIpv6NlriParserHelper {
                     .INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode
                     = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
-            valueNode.ifPresent(dataContainerChild
-                    -> nextHeadersBuilder.setValue((Short) dataContainerChild.getValue()));
+            valueNode.ifPresent(
+                dataContainerChild -> nextHeadersBuilder.setValue((Short) dataContainerChild.getValue()));
             nextHeaders.add(nextHeadersBuilder.build());
         }
 
@@ -106,8 +106,8 @@ public final class FlowspecIpv6NlriParserHelper {
                     .INSTANCE.create((Set<String>) dataContainerChild.getValue())));
             final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode
                     = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
-            valueNode.ifPresent(dataContainerChild
-                    -> flowLabelsBuilder.setValue((Long) dataContainerChild.getValue()));
+            valueNode.ifPresent(
+                dataContainerChild -> flowLabelsBuilder.setValue((Long) dataContainerChild.getValue()));
             flowLabels.add(flowLabelsBuilder.build());
         }
 
index a0ec5f5a0865393d7b8bc5dd5b259c590eea930a..f77946a3f950b8637e881150569c49d0dcb90ba7 100644 (file)
@@ -46,7 +46,7 @@ public abstract class AbstractFlowspecL3vpnNlriParser extends AbstractFlowspecNl
     }
 
     /**
-     * For flowspec-l3vpn, there is a route distinguisher field at the beginning of NLRI (8 bytes)
+     * For flowspec-l3vpn, there is a route distinguisher field at the beginning of NLRI (8 bytes).
      */
     private static RouteDistinguisher readRouteDistinguisher(final ByteBuf nlri) {
         final RouteDistinguisher rd = RouteDistinguisherUtil.parseRouteDistinguisher(nlri);
index 47592c757b1130ab5aea8132f3c8d49ef6e62d5d..8c7f4218295d3e594a59089ee4df2b7c62ff90fd 100644 (file)
@@ -43,8 +43,8 @@ public abstract class AbstractFlowspecL3vpnRIBSupport
             final Class<? extends AddressFamily> afiClass,
             final T flowspecNlriParser
     ) {
-        super(mappingService, cazeClass, containerClass, listClass, afiClass, FlowspecL3vpnSubsequentAddressFamily.class,
-                dstContainerClassQName, flowspecNlriParser);
+        super(mappingService, cazeClass, containerClass, listClass, afiClass,
+            FlowspecL3vpnSubsequentAddressFamily.class, dstContainerClassQName, flowspecNlriParser);
     }
 
     @Override
index e25d5a6bbd75a0bfe89726eafbda97b2a688b9bc..fac5aa30b1906581e677d852a83d5c54f0471f8f 100644 (file)
@@ -25,6 +25,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 
 /**
+ * L3 VPN IPv4 flowspec parser.
+ *
  * @author Kevin Wang
  */
 public final class FlowspecL3vpnIpv4NlriParser extends AbstractFlowspecL3vpnNlriParser {
@@ -34,31 +36,31 @@ public final class FlowspecL3vpnIpv4NlriParser extends AbstractFlowspecL3vpnNlri
     }
 
     @Override
-    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
-            .setDestinationFlowspecL3vpnIpv4(
-                new DestinationFlowspecL3vpnIpv4Builder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+                .setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder()
                     .setRouteDistinguisher(rd)
                     .setFlowspec(flowspecList)
                     .setPathId(pathId)
-                    .build()
-            ).build();
+                    .build()).build();
     }
 
     @Override
-    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
-            .setDestinationFlowspecL3vpnIpv4(
-                new DestinationFlowspecL3vpnIpv4Builder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+                .setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder()
                     .setRouteDistinguisher(rd)
                     .setFlowspec(flowspecList)
                     .setPathId(pathId)
-                    .build()
-            ).build();
+                    .build()).build();
     }
 
     @Override
@@ -73,9 +75,11 @@ public final class FlowspecL3vpnIpv4NlriParser extends AbstractFlowspecL3vpnNlri
 
     @Override
     protected void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) {
-            final DestinationFlowspecL3vpnIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) dstType)
-                .getDestinationFlowspecL3vpnIpv4();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) {
+            final DestinationFlowspecL3vpnIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
+                    .ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                    .DestinationFlowspecL3vpnIpv4Case) dstType).getDestinationFlowspecL3vpnIpv4();
             serializeNlri(
                 new Object[] {
                     destFlowspec.getRouteDistinguisher(),
@@ -89,9 +93,11 @@ public final class FlowspecL3vpnIpv4NlriParser extends AbstractFlowspecL3vpnNlri
 
     @Override
     protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) {
-            final DestinationFlowspecL3vpnIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) dstType)
-                .getDestinationFlowspecL3vpnIpv4();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) {
+            final DestinationFlowspecL3vpnIpv4 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
+                    .ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .DestinationFlowspecL3vpnIpv4Case) dstType).getDestinationFlowspecL3vpnIpv4();
             serializeNlri(
                 new Object[] {
                     destFlowspec.getRouteDistinguisher(),
index 828f0c6d84f5f008a9a89775f579a16520d08f31..60d64e57d2c8727a4f86c11e51f50ac99f9c19d4 100644 (file)
@@ -58,7 +58,7 @@ public final class FlowspecL3vpnIpv4RIBSupport
     public static synchronized FlowspecL3vpnIpv4RIBSupport getInstance(
             final SimpleFlowspecExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        if(SINGLETON == null){
+        if (SINGLETON == null) {
             SINGLETON = new FlowspecL3vpnIpv4RIBSupport(context, mappingService);
         }
         return SINGLETON;
index a86c951d15dddaf765955d8300a392b484964346..427bb31cc8b1e1cbd9b3fe3ff4ab8765efae8484 100644 (file)
@@ -25,6 +25,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 
 /**
+ * L3 VPN IPv6 flowspec parser.
+ *
  * @author Kevin Wang
  */
 public final class FlowspecL3vpnIpv6NlriParser extends AbstractFlowspecL3vpnNlriParser {
@@ -34,31 +36,31 @@ public final class FlowspecL3vpnIpv6NlriParser extends AbstractFlowspecL3vpnNlri
     }
 
     @Override
-    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
-            .setDestinationFlowspecL3vpnIpv6(
-                new DestinationFlowspecL3vpnIpv6Builder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+                .setDestinationFlowspecL3vpnIpv6(new DestinationFlowspecL3vpnIpv6Builder()
                     .setRouteDistinguisher(rd)
                     .setFlowspec(flowspecList)
                     .setPathId(pathId)
-                    .build()
-            ).build();
+                    .build()).build();
     }
 
     @Override
-    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
+    public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields,
+            @Nullable final PathId pathId) {
         final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
-            .setDestinationFlowspecL3vpnIpv6(
-                new DestinationFlowspecL3vpnIpv6Builder()
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+                .setDestinationFlowspecL3vpnIpv6(new DestinationFlowspecL3vpnIpv6Builder()
                     .setRouteDistinguisher(rd)
                     .setFlowspec(flowspecList)
                     .setPathId(pathId)
-                    .build()
-            ).build();
+                    .build()).build();
     }
 
     @Override
@@ -73,9 +75,11 @@ public final class FlowspecL3vpnIpv6NlriParser extends AbstractFlowspecL3vpnNlri
 
     @Override
     protected void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
-            final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) dstType)
-                .getDestinationFlowspecL3vpnIpv6();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
+            final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
+                    .ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                    .DestinationFlowspecL3vpnIpv6Case) dstType).getDestinationFlowspecL3vpnIpv6();
             serializeNlri(
                 new Object[] {
                     destFlowspec.getRouteDistinguisher(),
@@ -89,9 +93,11 @@ public final class FlowspecL3vpnIpv6NlriParser extends AbstractFlowspecL3vpnNlri
 
     @Override
     protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
-        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
-            final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) dstType)
-                .getDestinationFlowspecL3vpnIpv6();
+        if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329
+                .update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
+            final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
+                    .ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                    .DestinationFlowspecL3vpnIpv6Case) dstType).getDestinationFlowspecL3vpnIpv6();
             serializeNlri(
                 new Object[] {
                     destFlowspec.getRouteDistinguisher(),
index c2f85d5cc2f3916e56a25596572e3626bf08e85a..65c91c661172ed118ed21224881d552df4325c39 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.bgp.flowspec;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
@@ -28,8 +29,10 @@ public class ActivatorTest {
         assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(FLOWSPEC_SAFI));
         assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(FLOWSPEC_VPN_SAFI));
         act.start(context);
-        assertEquals(FlowspecSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(FLOWSPEC_SAFI));
-        assertEquals(FlowspecL3vpnSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(FLOWSPEC_VPN_SAFI));
+        assertEquals(FlowspecSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry()
+            .classForFamily(FLOWSPEC_SAFI));
+        assertEquals(FlowspecL3vpnSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry()
+            .classForFamily(FLOWSPEC_VPN_SAFI));
         act.close();
     }
 }
index 6ebd913d88d64405851897fbc9c0af1866997ace..a724b93db3e9390183fba7e0c1e08239764851c7 100644 (file)
@@ -64,12 +64,12 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
             = Collections.singletonList(new FlowspecBuilder().setFlowspecType(DEST_PREFIX).build());
     private static final DestinationFlowspecIpv4 DEST_FLOW = new DestinationFlowspecIpv4Builder()
             .setFlowspec(FLOW_LIST).setPathId(PATH_ID).build();
-    private static final DestinationFlowspecCase REACH_NLRI
-            = new DestinationFlowspecCaseBuilder().setDestinationFlowspecIpv4(DEST_FLOW).build();
+    private static final DestinationFlowspecCase REACH_NLRI = new DestinationFlowspecCaseBuilder()
+            .setDestinationFlowspecIpv4(DEST_FLOW).build();
     private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
-        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase UNREACH_NLRI
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
-        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCaseBuilder()
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase UNREACH_NLRI =
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCaseBuilder()
             .setDestinationFlowspecIpv4(DEST_FLOW).build();
 
     @Override
@@ -103,8 +103,7 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
     @Test
     public void testPutRoutes() {
         this.ribSupport.putRoutes(this.tx, getTablePath(), createNlriAdvertiseRoute(REACH_NLRI), createAttributes());
-        final FlowspecRoute route = (FlowspecRoute) this.insertedRoutes.get(0).getValue();
-        assertEquals(this.route, route);
+        assertEquals(this.route, this.insertedRoutes.get(0).getValue());
     }
 
     @Test
@@ -185,9 +184,9 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
         tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
         Assert.assertTrue(this.ribSupport.changedRoutes(tree).isEmpty());
 
-        final Routes routes = new FlowspecRoutesCaseBuilder().setFlowspecRoutes(new FlowspecRoutesBuilder()
-            .setFlowspecRoute(Collections.singletonList(this.route)).build()).build();
-        tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
+        tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(new FlowspecRoutesCaseBuilder()
+            .setFlowspecRoutes(new FlowspecRoutesBuilder().setFlowspecRoute(Collections.singletonList(this.route))
+                .build()).build())).getRootNode();
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
index 318249ddb23a66236d7f2ad627b88ab62e64064e..21d788350ef5628c56287865f2c6b50ed0567702 100644 (file)
@@ -101,8 +101,7 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecI
     @Test
     public void testPutRoutes() {
         this.ribSupport.putRoutes(this.tx, getTablePath(), createNlriAdvertiseRoute(REACH_NLRI), createAttributes());
-        final FlowspecRoute route = (FlowspecRoute) this.insertedRoutes.get(0).getValue();
-        assertEquals(this.route, route);
+        assertEquals(this.route, this.insertedRoutes.get(0).getValue());
     }
 
     @Test
@@ -185,10 +184,9 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecI
         tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
         Assert.assertTrue(this.ribSupport.changedRoutes(tree).isEmpty());
 
-        final Routes routes = new FlowspecIpv6RoutesCaseBuilder()
-                .setFlowspecIpv6Routes(new FlowspecIpv6RoutesBuilder()
-            .setFlowspecRoute(Collections.singletonList(this.route)).build()).build();
-        tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
+        tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(new FlowspecIpv6RoutesCaseBuilder()
+            .setFlowspecIpv6Routes(new FlowspecIpv6RoutesBuilder()
+                .setFlowspecRoute(Collections.singletonList(this.route)).build()).build())).getRootNode();
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
index 0d3f75f820c6e2a20883ad0df7f0d52cc2854d9e..4126b908460f8ca55fc7da31e8ee831f8effff59 100644 (file)
@@ -103,7 +103,8 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContaine
 
 public class FlowspecL3vpnIpv4NlriParserTest {
 
-    private static final NodeIdentifier RD_NID = new NodeIdentifier(QName.create(Flowspec.QNAME.getNamespace(), Flowspec.QNAME.getRevision(), "route-distinguisher"));
+    private static final NodeIdentifier RD_NID = new NodeIdentifier(QName.create(Flowspec.QNAME.getNamespace(),
+        Flowspec.QNAME.getRevision(), "route-distinguisher"));
     private static final NodeIdentifier PROTOCOL_IP_NID = new NodeIdentifier(ProtocolIps.QNAME);
 
     private static final String ROUTE_DISTINGUISHER = "1.2.3.4:10";
@@ -163,7 +164,9 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
     private final SimpleFlowspecExtensionProviderContext flowspecContext = new SimpleFlowspecExtensionProviderContext();
     private final FlowspecActivator fsa = new FlowspecActivator(this.flowspecContext);
-    private final FlowspecL3vpnIpv4NlriParser FS_PARSER = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+    private final FlowspecL3vpnIpv4NlriParser fsParser = new FlowspecL3vpnIpv4NlriParser(
+        this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+            SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
 
     @Before
     public void setUp() {
@@ -178,10 +181,12 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationPrefixCase destinationPrefix = new DestinationPrefixCaseBuilder().setDestinationPrefix(new Ipv4Prefix("10.0.1.0/32")).build();
+        final DestinationPrefixCase destinationPrefix = new DestinationPrefixCaseBuilder().setDestinationPrefix(
+            new Ipv4Prefix("10.0.1.0/32")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
-        final SourcePrefixCase sourcePrefix = new SourcePrefixCaseBuilder().setSourcePrefix(new Ipv4Prefix("1.2.3.4/32")).build();
+        final SourcePrefixCase sourcePrefix = new SourcePrefixCaseBuilder().setSourcePrefix(
+            new Ipv4Prefix("1.2.3.4/32")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
@@ -201,15 +206,19 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         builder.setFlowspecType(sps);
         fs.add(builder.build());
 
-        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(
+            this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
 
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv4AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI), result, null);
 
-        final DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv4();
+        final DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecL3vpnIpv4Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv4();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
@@ -217,7 +226,8 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
         mp.setAdvertizedRoutes(
             new AdvertizedRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
                     .setDestinationFlowspecL3vpnIpv4(
                         new DestinationFlowspecL3vpnIpv4Builder()
                             .setRouteDistinguisher(rd)
@@ -228,10 +238,15 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv4AddressFamily.class).build()).build()).build(), buffer);
+        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv4AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 10.0.1.0/32 AND from 1.2.3.4/32 AND where IP protocol equals to 6 AND where port is greater than or equals to 137 and is less than or equals to 139 or equals to 8080 AND where destination port is greater than 4089 or equals to 179 AND where source port equals to 8080 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 10.0.1.0/32 AND from 1.2.3.4/32 AND where IP protocol equals to 6 AND where port "
+                + "is greater than or equals to 137 and is less than or equals to 139 or equals to 8080 AND where "
+                + "destination port is greater than 4089 or equals to 179 AND where source port equals to 8080 ",
+                this.fsParser.stringNlri(flows));
     }
 
     private static void testFlows(
@@ -255,18 +270,23 @@ public class FlowspecL3vpnIpv4NlriParserTest {
     }
 
     private static FlowspecType createSps() {
-        final List<SourcePorts> sports = Lists.newArrayList(new SourcePortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(8080).build());
+        final List<SourcePorts> sports = Lists.newArrayList(new SourcePortsBuilder().setOp(
+            new NumericOperand(false, true, true, false, false)).setValue(8080).build());
         return new SourcePortCaseBuilder().setSourcePorts(sports).build();
     }
 
     private static FlowspecType createProts() {
-        final List<ProtocolIps> protocols = Lists.newArrayList(new ProtocolIpsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+        final List<ProtocolIps> protocols = Lists.newArrayList(new ProtocolIpsBuilder().setOp(
+            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
         return new ProtocolIpCaseBuilder().setProtocolIps(protocols).build();
     }
 
     private static FlowspecType createDps() {
-        final List<DestinationPorts> destports = Lists.newArrayList(new DestinationPortsBuilder().setOp(new NumericOperand(false, false, false, true, false)).setValue(4089).build(),
-            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(179).build());
+        final List<DestinationPorts> destports = Lists.newArrayList(
+            new DestinationPortsBuilder().setOp(new NumericOperand(false, false, false, true, false)).setValue(4089)
+            .build(),
+            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(179)
+            .build());
         return new DestinationPortCaseBuilder().setDestinationPorts(destports).build();
     }
 
@@ -276,10 +296,12 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationPrefixCase destinationPrefix = new DestinationPrefixCaseBuilder().setDestinationPrefix(new Ipv4Prefix("10.0.1.0/32")).build();
+        final DestinationPrefixCase destinationPrefix = new DestinationPrefixCaseBuilder().setDestinationPrefix(
+            new Ipv4Prefix("10.0.1.0/32")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
-        final SourcePrefixCase sourcePrefix = new SourcePrefixCaseBuilder().setSourcePrefix(new Ipv4Prefix("1.2.3.4/32")).build();
+        final SourcePrefixCase sourcePrefix = new SourcePrefixCaseBuilder().setSourcePrefix(
+            new Ipv4Prefix("1.2.3.4/32")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
@@ -299,15 +321,19 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         builder.setFlowspecType(sps);
         fs.add(builder.build());
 
-        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(
+            this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
 
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv4AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        final DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv4();
+        final DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecL3vpnIpv4Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv4();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
@@ -315,7 +341,8 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
         mp.setAdvertizedRoutes(
             new AdvertizedRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
                     .setDestinationFlowspecL3vpnIpv4(
                         new DestinationFlowspecL3vpnIpv4Builder()
                             .setRouteDistinguisher(rd)
@@ -327,14 +354,20 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv4AddressFamily.class).build()).build()).build(), buffer);
+        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv4AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 10.0.1.0/32 AND from 1.2.3.4/32 AND where IP protocol equals to 6 AND where port is greater than or equals to 137 and is less than or equals to 139 or equals to 8080 AND where destination port is greater than 4089 or equals to 179 AND where source port equals to 8080 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 10.0.1.0/32 AND from 1.2.3.4/32 AND where IP protocol equals to 6 AND where port "
+                + "is greater than or equals to 137 and is less than or equals to 139 or equals to 8080 AND where "
+                + "destination port is greater than 4089 or equals to 179 AND where source port equals to 8080 ",
+                this.fsParser.stringNlri(flows));
     }
 
     private static PortCase createPorts() {
-        final List<Ports> ports = Lists.newArrayList(new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(137).build(),
+        final List<Ports> ports = Lists.newArrayList(
+            new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(137).build(),
             new PortsBuilder().setOp(new NumericOperand(true, false, true, false, true)).setValue(139).build(),
             new PortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(8080).build());
 
@@ -372,22 +405,27 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         builder.setFlowspecType(fragment);
         fs.add(builder.build());
 
-        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(
+            this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
 
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv4AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result, null);
 
-        DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv4();
+        DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                .bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv4();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         checkUnreachFlows(flows, icmpType, icmpCode, tcp, packet, dscp, fragment);
 
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
         mp.setAfi(Ipv4AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv4(
                     new DestinationFlowspecL3vpnIpv4Builder()
                         .setRouteDistinguisher(rd)
@@ -401,43 +439,52 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         parser.serializeNlri(new Object[] {rd, flows}, null, buffer);
         assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
         assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 "
+                + "or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 "
+                + "AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ",
+                this.fsParser.stringNlri(flows));
 
     }
 
     private static FlowspecType createFragment() {
-        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
+        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(
+            new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
         return new FragmentCaseBuilder().setFragments(fragments).build();
     }
 
     private static FlowspecType createDscp() {
-        final List<Dscps> dscps = Lists.newArrayList(new DscpsBuilder().setOp(new NumericOperand(false, true, false, true, false)).setValue(new Dscp((short) 42)).build());
+        final List<Dscps> dscps = Lists.newArrayList(new DscpsBuilder().setOp(
+            new NumericOperand(false, true, false, true, false)).setValue(new Dscp((short) 42)).build());
         return new DscpCaseBuilder().setDscps(dscps).build();
     }
 
     private static PacketLengthCase createPackets() {
-        final List<PacketLengths> packets = Lists.newArrayList(new PacketLengthsBuilder().setOp(new NumericOperand(false, true, false, false, true))
-            .setValue(57005).build());
+        final List<PacketLengths> packets = Lists.newArrayList(new PacketLengthsBuilder().setOp(
+            new NumericOperand(false, true, false, false, true)).setValue(57005).build());
         return new PacketLengthCaseBuilder().setPacketLengths(packets).build();
     }
 
     private static TcpFlagsCase createTcp() {
-        final List<TcpFlags> flags = Lists.newArrayList(new TcpFlagsBuilder().setOp(new BitmaskOperand(false, false, false, true)).setValue(1025).build(),
+        final List<TcpFlags> flags = Lists.newArrayList(
+            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, false, false, true)).setValue(1025).build(),
             new TcpFlagsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(22193).build());
         return new TcpFlagsCaseBuilder().setTcpFlags(flags).build();
     }
 
     private static FlowspecType createIcmpCode() {
-        final List<Codes> codes = Lists.newArrayList(new CodesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 4).build(),
+        final List<Codes> codes = Lists.newArrayList(
+            new CodesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 4).build(),
             new CodesBuilder().setOp(new NumericOperand(false, true, false, false, false)).setValue((short) 5).build());
         return new IcmpCodeCaseBuilder().setCodes(codes).build();
     }
 
     private static FlowspecType createIcmpType() {
-        final List<Types> types = Lists.newArrayList(new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 2).build(),
+        final List<Types> types = Lists.newArrayList(
+            new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 2).build(),
             new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue((short) 3).build());
         return new IcmpTypeCaseBuilder().setTypes(types).build();
     }
@@ -485,22 +532,27 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         builder.setFlowspecType(fragment);
         fs.add(builder.build());
 
-        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
+        final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(
+            this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
+                SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
 
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv4AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
         parser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv4();
+        DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                .bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv4();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         checkUnreachFlows(flows, icmpType, icmpCode, tcp, packet, dscp, fragment);
 
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
         mp.setAfi(Ipv4AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv4(
                     new DestinationFlowspecL3vpnIpv4Builder()
                         .setRouteDistinguisher(rd)
@@ -515,16 +567,21 @@ public class FlowspecL3vpnIpv4NlriParserTest {
         parser.serializeNlri(new Object[] {rd, flows}, PATH_ID, buffer);
         assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
         assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 "
+                + "or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 "
+                + "AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ",
+                this.fsParser.stringNlri(flows));
 
     }
 
     @Test
     public void testExtractFlowspecDestPrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -532,18 +589,21 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PREFIX_NID).withValue("127.0.0.5/32").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PREFIX_NID)
+                        .withValue("127.0.0.5/32").build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationPrefixCaseBuilder().setDestinationPrefix(new Ipv4Prefix("127.0.0.5/32")).build());
+        expectedFS.setFlowspecType(new DestinationPrefixCaseBuilder().setDestinationPrefix(
+            new Ipv4Prefix("127.0.0.5/32")).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourcePrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -551,18 +611,21 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.SOURCE_PREFIX_NID).withValue("127.0.0.6/32").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.SOURCE_PREFIX_NID)
+                        .withValue("127.0.0.6/32").build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourcePrefixCaseBuilder().setSourcePrefix(new Ipv4Prefix("127.0.0.6/32")).build());
+        expectedFS.setFlowspecType(new SourcePrefixCaseBuilder().setSourcePrefix(new Ipv4Prefix("127.0.0.6/32"))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecProtocolIps() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -572,29 +635,42 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(PROTOCOL_IP_NID)
                         .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)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue((short) 100).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .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())
                         .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())
+                            .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())
                         .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())
+                            .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())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new ProtocolIpCaseBuilder().setProtocolIps(Lists.newArrayList(
-            new ProtocolIpsBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new ProtocolIpsBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false)).build(),
-            new ProtocolIpsBuilder().setValue((short) 240).setOp(new NumericOperand(true, true, true, false, false)).build())).build());
+            new ProtocolIpsBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
+            .build(),
+            new ProtocolIpsBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
+            .build(),
+            new ProtocolIpsBuilder().setValue((short) 240).setOp(new NumericOperand(true, true, true, false, false))
+            .build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecPorts() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -604,20 +680,26 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.PORTS_NID)
                         .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.LESS_THAN_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue(100).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
+                                    AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE))
+                                .build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue(100).build()).build())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new PortCaseBuilder().setPorts(Lists.newArrayList(new PortsBuilder().setValue(100).setOp(new NumericOperand(true, true, false, false, true)).build())).build());
+        expectedFS.setFlowspecType(new PortCaseBuilder().setPorts(Lists.newArrayList(new PortsBuilder().setValue(100)
+            .setOp(new NumericOperand(true, true, false, false, true)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecDestinationPorts() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -625,21 +707,29 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PORT_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID).withValue(1024).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PORT_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
+                                    AbstractNumericOperandParser.EQUALS_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
+                                .withValue(1024).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(new DestinationPortsBuilder().setValue(1024).setOp(new NumericOperand(false, true, true, false, false)).build())).build());
+        expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(
+            new DestinationPortsBuilder().setValue(1024).setOp(new NumericOperand(false, true, true, false, false))
+            .build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourcePorts() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -647,21 +737,31 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.SOURCE_PORT_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue(8080).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.SOURCE_PORT_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE,
+                                    AbstractNumericOperandParser.GREATER_THAN_VALUE,
+                                    AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue(8080).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(new SourcePortsBuilder().setValue(8080).setOp(new NumericOperand(true, true, true, true, true)).build())).build());
+        expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(
+            new SourcePortsBuilder().setValue(8080).setOp(new NumericOperand(true, true, true, true, true)).build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourceTypes() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -669,21 +769,31 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.ICMP_TYPE_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue((short) 22).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.ICMP_TYPE_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE,
+                                    AbstractNumericOperandParser.GREATER_THAN_VALUE,
+                                    AbstractNumericOperandParser.LESS_THAN_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue((short) 22).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(new TypesBuilder().setValue((short) 22).setOp(new NumericOperand(true, true, true, true, true)).build())).build());
+        expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(
+            new TypesBuilder().setValue((short) 22).setOp(new NumericOperand(true, true, true, true, true)).build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourceCodes() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -691,21 +801,27 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.ICMP_CODE_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet()).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue((short) 23).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.ICMP_CODE_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue((short) 23).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder().setValue((short) 23).setOp(new NumericOperand(false, false, false, false, false)).build())).build());
+        expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder()
+            .setValue((short) 23).setOp(new NumericOperand(false, false, false, false, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourceTcpFlags() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -713,21 +829,28 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.TCP_FLAGS_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue(99).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.TCP_FLAGS_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue(99).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder().setValue(99).setOp(new BitmaskOperand(true, true, false, false)).build())).build());
+        expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
+            .setValue(99).setOp(new BitmaskOperand(true, true, false, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecPacketLengths() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -735,21 +858,29 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.PACKET_LENGTHS_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue(101).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.PACKET_LENGTHS_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue(101).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(new PacketLengthsBuilder().setValue(101).setOp(new NumericOperand(true, false, false, true, false)).build())).build());
+        expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(
+            new PacketLengthsBuilder().setValue(101).setOp(
+                new NumericOperand(true, false, false, true, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecDscps() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -758,20 +889,27 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DSCP_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue((short) 15).build()).build())
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE,
+                                    AbstractNumericOperandParser.GREATER_THAN_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue((short) 15).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder().setValue(new Dscp((short) 15)).setOp(new NumericOperand(true, true, false, true, false)).build())).build());
+        expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder().setValue(
+            new Dscp((short) 15)).setOp(new NumericOperand(true, true, false, true, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecFragments() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -779,21 +917,32 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE, BitmaskOperandParser.NOT_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID).withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE, AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE, AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE,
+                                    BitmaskOperandParser.NOT_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID)
+                                .withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE,
+                                    AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE,
+                                    AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(new FragmentsBuilder().setValue(new Fragment(true, true, true, true)).setOp(new BitmaskOperand(true, true, true, true)).build())).build());
+        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(new FragmentsBuilder()
+            .setValue(new Fragment(true, true, true, true)).setOp(new BitmaskOperand(true, true, true, true)).build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
-        assertEquals(expected, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecRouteDistinguisher() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(
             Builders.leafBuilder()
index 9cde610bd69f446586c0c35272e820f426ec3cc7..c1881ab873d398a126dda48ea82561c95c4b8cba 100644 (file)
@@ -69,8 +69,8 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
     private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
             .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case UNREACH_NLRI
             = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
-            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
-            DestinationFlowspecL3vpnIpv4CaseBuilder().setDestinationFlowspecL3vpnIpv4(DEST_FLOW).build();
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder()
+            .setDestinationFlowspecL3vpnIpv4(DEST_FLOW).build();
     private FlowspecL3vpnIpv4RIBSupport ribSupport;
 
     static {
@@ -110,7 +110,8 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(
-            new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), ATTRIBUTES);
+            new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()),
+            ATTRIBUTES);
         assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
         assertNull(update.getAttributes().augmentation(Attributes1.class));
@@ -119,8 +120,10 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(
-            new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), Collections.emptyList(), ATTRIBUTES);
-        final AdvertizedRoutes advertised = update.getAttributes().augmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
+            new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()),
+            Collections.emptyList(), ATTRIBUTES);
+        final AdvertizedRoutes advertised = update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
+                .getAdvertizedRoutes();
         assertEquals(REACH_NLRI, advertised.getDestinationType());
         assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
index 773140e70638349bdff7d19659d8d743f7f7183e..468725f4217258cb0e02f117671e1afa59efc4a5 100644 (file)
@@ -86,7 +86,9 @@ public class FlowspecL3vpnIpv6NlriParserTest {
     private MultiPathSupport muliPathSupport;
     private final SimpleFlowspecExtensionProviderContext flowspecContext = new SimpleFlowspecExtensionProviderContext();
     private final FlowspecActivator fsa = new FlowspecActivator(this.flowspecContext);
-    private final FlowspecL3vpnIpv6NlriParser FS_PARSER = new FlowspecL3vpnIpv6NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
+    private final FlowspecL3vpnIpv6NlriParser fsParser = new FlowspecL3vpnIpv6NlriParser(
+        this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6,
+            SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
 
     private static final byte[] REACHED_NLRI = new byte[]{
         0x1B,   // NLRI length: 19+8=27
@@ -131,15 +133,18 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build();
+        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
+            new Ipv6Prefix("102:304:500::/40")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
 
-        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build();
+        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(
+            new Ipv6Prefix("102:304:600::/40")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
-        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder()
+            .setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -147,10 +152,12 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI), result, null);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI), result, null);
 
-        DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv6();
+        DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+                .bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecL3vpnIpv6Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv6();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
 
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
@@ -161,8 +168,9 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         assertEquals(sourcePrefix, flows.get(1).getFlowspecType());
         assertEquals(headersCase, flows.get(2).getFlowspecType());
 
-        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn
+            .opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes
+            .destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv6(
                     new DestinationFlowspecL3vpnIpv6Builder()
                         .setRouteDistinguisher(rd)
@@ -174,10 +182,13 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ",
+            this.fsParser.stringNlri(flows));
     }
 
     @Test
@@ -186,15 +197,18 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build();
+        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
+            new Ipv6Prefix("102:304:500::/40")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
 
-        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build();
+        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(
+            new Ipv6Prefix("102:304:600::/40")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
-        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder()
+            .setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -202,10 +216,12 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI_ADD_PATH), result, this.constraint);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv6();
+        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecL3vpnIpv6Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv6();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
@@ -215,8 +231,9 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         assertEquals(sourcePrefix, flows.get(1).getFlowspecType());
         assertEquals(headersCase, flows.get(2).getFlowspecType());
 
-        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn
+            .opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes
+            .destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv6(
                     new DestinationFlowspecL3vpnIpv6Builder()
                         .setPathId(PATH_ID)
@@ -228,10 +245,13 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ",
+            this.fsParser.stringNlri(flows));
     }
 
     @Test
@@ -252,10 +272,12 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result, null);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result, null);
 
-        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv6();
+        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecL3vpnIpv6Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv6();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
@@ -265,7 +287,8 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         assertEquals(label, flows.get(1).getFlowspecType());
 
         mp.setAfi(Ipv6AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv6(
                     new DestinationFlowspecL3vpnIpv6Builder()
                         .setRouteDistinguisher(rd)
@@ -276,22 +299,27 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
 
         assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to 16777222 or equals to 258 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to "
+                + "16777222 or equals to 258 ", this.fsParser.stringNlri(flows));
     }
 
     private static FragmentCase createFragment() {
-        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
+        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(
+            new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
         return new FragmentCaseBuilder().setFragments(fragments).build();
     }
 
     private static FlowspecType createLabel() {
         final List<FlowLabel> labels = new ArrayList<>(2);
-        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false)).setValue(16777222L).build());
-        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(258L).build());
+        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false))
+            .setValue(16777222L).build());
+        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false))
+            .setValue(258L).build());
         return new FlowLabelCaseBuilder().setFlowLabel(labels).build();
     }
 
@@ -313,10 +341,12 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecL3vpnIpv6();
+        final DestinationFlowspecL3vpnIpv6 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+                .yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecL3vpnIpv6Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecL3vpnIpv6();
         final List<Flowspec> flows = flowspecDst.getFlowspec();
         final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
 
@@ -326,7 +356,8 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         assertEquals(label, flows.get(1).getFlowspecType());
 
         mp.setAfi(Ipv6AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder()
                 .setDestinationFlowspecL3vpnIpv6(
                     new DestinationFlowspecL3vpnIpv6Builder()
                         .setRouteDistinguisher(rd)
@@ -338,16 +369,19 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         );
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
 
         assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to 16777222 or equals to 258 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to "
+                + "16777222 or equals to 258 ", this.fsParser.stringNlri(flows));
     }
 
     @Test
     public void testExtractFlowspecFragments() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -355,21 +389,32 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE, BitmaskOperandParser.NOT_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID).withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE, AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE, AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE,
+                                    BitmaskOperandParser.NOT_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
+                                .withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE,
+                                    AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE,
+                                    AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(new FragmentsBuilder().setValue(new Fragment(true, true, true, true)).setOp(new BitmaskOperand(true, true, true, true)).build())).build());
+        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(
+            new FragmentsBuilder().setValue(new Fragment(true, true, true, true)).setOp(
+                new BitmaskOperand(true, true, true, true)).build())).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecNextHeaders() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -379,29 +424,42 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                         .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)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID).withValue((short) 100).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
+                                .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())
                         .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())
+                            .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())
                         .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())
+                            .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())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new NextHeaderCaseBuilder().setNextHeaders(Lists.newArrayList(
-            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false)).build(),
-            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false)).build())).build());
+            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
+            .build(),
+            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
+            .build(),
+            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false))
+            .build())).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecFlowLabels() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -411,25 +469,32 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(FLOW_LABEL_NID)
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID).withValue(100L).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
+                                    AbstractOperandParser.AND_BIT_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID)
+                                .withValue(100L).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())
+                            .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())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new FlowLabelCaseBuilder().setFlowLabel(Lists.newArrayList(
             new FlowLabelBuilder().setValue(100L).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build())).build());
+            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build()))
+            .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecDestPrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -437,17 +502,20 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.DEST_PREFIX_NID).withValue("102:304:500::/40").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.DEST_PREFIX_NID)
+                        .withValue("102:304:500::/40").build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build());
+        expectedFS.setFlowspecType(new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
+            new Ipv6Prefix("102:304:500::/40")).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourcePrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -455,12 +523,14 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(SimpleFlowspecIpv4NlriParser.SOURCE_PREFIX_NID).withValue("102:304:600::/40").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(SimpleFlowspecIpv4NlriParser.SOURCE_PREFIX_NID)
+                        .withValue("102:304:600::/40").build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build());
+        expectedFS.setFlowspecType(new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40"))
+            .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 }
 
index 7e8ebe48cc8745d8715a7e747bd5f03662839390..4448b1fc476e86ebe7de4af43130c110a04ddcff 100644 (file)
@@ -81,7 +81,9 @@ public class SimpleFlowspecIpv6NlriParserTest {
     private MultiPathSupport muliPathSupport;
     private final SimpleFlowspecExtensionProviderContext flowspecContext = new SimpleFlowspecExtensionProviderContext();
     private final FlowspecActivator fsa = new FlowspecActivator(this.flowspecContext);
-    private final SimpleFlowspecIpv6NlriParser FS_PARSER = new SimpleFlowspecIpv6NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
+    private final SimpleFlowspecIpv6NlriParser fsParser = new SimpleFlowspecIpv6NlriParser(
+        this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV6,
+            SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
 
     private static final byte[] REACHED_NLRI = new byte[] {
         0x13,
@@ -122,22 +124,26 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build();
+        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder()
+                .setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
 
-        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build();
+        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(
+            new Ipv6Prefix("102:304:600::/40")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
-        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(
+            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
 
 
-        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn
+            .opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes
+            .destination.type.DestinationFlowspecIpv6CaseBuilder()
                 .setDestinationFlowspecIpv6(
                     new DestinationFlowspecIpv6Builder()
                         .setFlowspec(fs)
@@ -150,20 +156,25 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI), result, null);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI), result, null);
 
-        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecIpv6().getFlowspec();
+        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecIpv6Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecIpv6().getFlowspec();
         assertEquals(3, flows.size());
         assertEquals(destinationPrefix, flows.get(0).getFlowspecType());
         assertEquals(sourcePrefix, flows.get(1).getFlowspecType());
         assertEquals(headersCase, flows.get(2).getFlowspecType());
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ",
+            this.fsParser.stringNlri(flows));
     }
 
     @Test
@@ -172,22 +183,26 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpReachNlriBuilder mp = new MpReachNlriBuilder();
 
         final FlowspecBuilder builder = new FlowspecBuilder();
-        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build();
+        final DestinationIpv6PrefixCase destinationPrefix = new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
+            new Ipv6Prefix("102:304:500::/40")).build();
         builder.setFlowspecType(destinationPrefix);
         fs.add(builder.build());
 
-        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build();
+        final SourceIpv6PrefixCase sourcePrefix = new SourceIpv6PrefixCaseBuilder().setSourcePrefix(
+            new Ipv6Prefix("102:304:600::/40")).build();
         builder.setFlowspecType(sourcePrefix);
         fs.add(builder.build());
 
-        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+        final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(
+            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
 
 
-        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+        mp.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn
+            .opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes
+            .destination.type.DestinationFlowspecIpv6CaseBuilder()
                 .setDestinationFlowspecIpv6(
                     new DestinationFlowspecIpv6Builder()
                         .setPathId(PATH_ID)
@@ -200,20 +215,25 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpReachNlriBuilder result = new MpReachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI_ADD_PATH), result, this.constraint);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(REACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecIpv6Case) result.getAdvertizedRoutes().getDestinationType())
-            .getDestinationFlowspecIpv6().getFlowspec();
+        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationFlowspecIpv6Case) result.getAdvertizedRoutes().getDestinationType())
+                .getDestinationFlowspecIpv6().getFlowspec();
         assertEquals(3, flows.size());
         assertEquals(destinationPrefix, flows.get(0).getFlowspecType());
         assertEquals(sourcePrefix, flows.get(1).getFlowspecType());
         assertEquals(headersCase, flows.get(2).getFlowspecType());
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes1.class,
+            new Attributes1Builder().setMpReachNlri(mp.setAfi(Ipv6AddressFamily.class).build()).build()).build(),
+            buffer);
         assertArrayEquals(REACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets to 102:304:500::/40 AND from 102:304:600::/40 AND where next header equals to 6 ",
+            this.fsParser.stringNlri(flows));
     }
 
     @Test
@@ -232,7 +252,8 @@ public class SimpleFlowspecIpv6NlriParserTest {
         fs.add(builder.build());
 
         mp.setAfi(Ipv6AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
                 .setDestinationFlowspecIpv6(
                     new DestinationFlowspecIpv6Builder()
                         .setFlowspec(fs)
@@ -244,31 +265,38 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result, null);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result, null);
 
-        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecIpv6().getFlowspec();
+        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecIpv6Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecIpv6().getFlowspec();
         assertEquals(2, flows.size());
         assertEquals(fragment, flows.get(0).getFlowspecType());
         assertEquals(label, flows.get(1).getFlowspecType());
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
 
         assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to 16777222 or equals to 258 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to "
+                + "16777222 or equals to 258 ", this.fsParser.stringNlri(flows));
     }
 
     private static FragmentCase createFragment() {
-        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
+        final List<Fragments> fragments = Lists.newArrayList(new FragmentsBuilder().setOp(
+            new BitmaskOperand(false, true, true, false)).setValue(new Fragment(false, true, true, true)).build());
         return new FragmentCaseBuilder().setFragments(fragments).build();
     }
 
     private static FlowspecType createLabel() {
         final List<FlowLabel> labels = new ArrayList<>(2);
-        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false)).setValue(16777222L).build());
-        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(258L).build());
+        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false))
+            .setValue(16777222L).build());
+        labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false))
+            .setValue(258L).build());
         return new FlowLabelCaseBuilder().setFlowLabel(labels).build();
     }
 
@@ -288,7 +316,8 @@ public class SimpleFlowspecIpv6NlriParserTest {
         fs.add(builder.build());
 
         mp.setAfi(Ipv6AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6CaseBuilder()
                 .setDestinationFlowspecIpv6(
                     new DestinationFlowspecIpv6Builder()
                         .setPathId(PATH_ID)
@@ -301,25 +330,30 @@ public class SimpleFlowspecIpv6NlriParserTest {
         final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
         result.setAfi(Ipv6AddressFamily.class);
         result.setSafi(FlowspecSubsequentAddressFamily.class);
-        this.FS_PARSER.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
+        this.fsParser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
 
-        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecIpv6Case) result.getWithdrawnRoutes().getDestinationType())
-            .getDestinationFlowspecIpv6().getFlowspec();
+        final List<Flowspec> flows = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec
+                .rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationFlowspecIpv6Case) result.getWithdrawnRoutes().getDestinationType())
+                .getDestinationFlowspecIpv6().getFlowspec();
         assertEquals(2, flows.size());
         assertEquals(fragment, flows.get(0).getFlowspecType());
         assertEquals(label, flows.get(1).getFlowspecType());
 
         final ByteBuf buffer = Unpooled.buffer();
-        this.FS_PARSER.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
+        this.fsParser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class,
+            new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
 
         assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
 
-        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to 16777222 or equals to 258 ", this.FS_PARSER.stringNlri(flows));
+        assertEquals("all packets where fragment does match 'IS FIRST' 'IS LAST' 'IS A' AND where flow label equals to "
+                + "16777222 or equals to 258 ", this.fsParser.stringNlri(flows));
     }
 
     @Test
     public void testExtractFlowspecFragments() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -327,21 +361,32 @@ public class SimpleFlowspecIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
-                        .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE, BitmaskOperandParser.NOT_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID).withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE, AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE, AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
+                    .withChild(Builders.unkeyedListBuilder()
+                        .withNodeIdentifier(AbstractFlowspecNlriParser.FRAGMENT_NID)
+                        .withChild(Builders.unkeyedListEntryBuilder()
+                            .withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE,
+                                    AbstractOperandParser.END_OF_LIST_VALUE, BitmaskOperandParser.MATCH_VALUE,
+                                    BitmaskOperandParser.NOT_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
+                                .withValue(Sets.newHashSet(AbstractFlowspecNlriParser.DO_NOT_VALUE,
+                                    AbstractFlowspecNlriParser.FIRST_VALUE, AbstractFlowspecNlriParser.IS_A_VALUE,
+                                    AbstractFlowspecNlriParser.LAST_VALUE)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(new FragmentsBuilder().setValue(new Fragment(true, true, true, true)).setOp(new BitmaskOperand(true, true, true, true)).build())).build());
+        expectedFS.setFlowspecType(new FragmentCaseBuilder().setFragments(Lists.newArrayList(new FragmentsBuilder()
+            .setValue(new Fragment(true, true, true, true)).setOp(new BitmaskOperand(true, true, true, true)).build()))
+            .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecNextHeaders() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -351,29 +396,42 @@ public class SimpleFlowspecIpv6NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(NEXT_HEADER_NID)
                         .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)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID).withValue((short) 100).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                                .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())
                         .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())
+                            .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())
                         .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())
+                            .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())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new NextHeaderCaseBuilder().setNextHeaders(Lists.newArrayList(
-            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false)).build(),
-            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false)).build())).build());
+            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
+            .build(),
+            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
+            .build(),
+            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false))
+            .build())).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecFlowLabels() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -383,25 +441,32 @@ public class SimpleFlowspecIpv6NlriParserTest {
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
                     .withChild(Builders.unkeyedListBuilder().withNodeIdentifier(FLOW_LABEL_NID)
                         .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID)
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID).withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build())
-                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID).withValue(100L).build()).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID)
+                                .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE,
+                                    AbstractOperandParser.AND_BIT_VALUE)).build())
+                            .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID)
+                                .withValue(100L).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())
+                            .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())
                         .build()).build()).build()).build());
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new FlowLabelCaseBuilder().setFlowLabel(Lists.newArrayList(
             new FlowLabelBuilder().setValue(100L).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build())).build());
+            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build()))
+            .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecDestPrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -409,17 +474,20 @@ public class SimpleFlowspecIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PREFIX_NID).withValue("102:304:500::/40").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.DEST_PREFIX_NID)
+                        .withValue("102:304:500::/40").build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(new Ipv6Prefix("102:304:500::/40")).build());
+        expectedFS.setFlowspecType(new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
+            new Ipv6Prefix("102:304:500::/40")).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 
     @Test
     public void testExtractFlowspecSourcePrefix() {
-        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry = Builders.mapEntryBuilder();
+        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> entry =
+                Builders.mapEntryBuilder();
         entry.withNodeIdentifier(new NodeIdentifierWithPredicates(FlowspecRoute.QNAME, FlowspecRoute.QNAME, entry));
         entry.withChild(Builders.unkeyedListBuilder()
             .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
@@ -427,12 +495,14 @@ public class SimpleFlowspecIpv6NlriParserTest {
                 .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_NID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(AbstractFlowspecNlriParser.FLOWSPEC_TYPE_NID)
-                    .withChild(Builders.leafBuilder().withNodeIdentifier(SimpleFlowspecIpv4NlriParser.SOURCE_PREFIX_NID).withValue("102:304:600::/40").build()).build()).build()).build());
+                    .withChild(Builders.leafBuilder().withNodeIdentifier(SimpleFlowspecIpv4NlriParser.SOURCE_PREFIX_NID)
+                        .withValue("102:304:600::/40").build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourceIpv6PrefixCaseBuilder().setSourcePrefix(new Ipv6Prefix("102:304:600::/40")).build());
+        expectedFS.setFlowspecType(new SourceIpv6PrefixCaseBuilder().setSourcePrefix(
+            new Ipv6Prefix("102:304:600::/40")).build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
-        assertEquals(expectedValue, this.FS_PARSER.extractFlowspec(entry.build()));
+        assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
     }
 }
 
index 6f67f37b3271534e36c3094089b0e8cbd7c87bf6..35ee5346d4b160f3bb0f9003a4df1eabb5fdf3bc 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.flowspec;
 
 import java.util.Optional;
@@ -26,10 +25,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 
 public class TableTypeActivatorTest {
 
-    private static final BgpTableType IPV4_FLOW = new BgpTableTypeImpl(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class);
-    private static final BgpTableType IPV6_FLOW = new BgpTableTypeImpl(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class);
-    private static final BgpTableType IPV4_VPN_FLOW = new BgpTableTypeImpl(Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class);
-    private static final BgpTableType IPV6_VPN_FLOW = new BgpTableTypeImpl(Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class);
+    private static final BgpTableType IPV4_FLOW = new BgpTableTypeImpl(Ipv4AddressFamily.class,
+        FlowspecSubsequentAddressFamily.class);
+    private static final BgpTableType IPV6_FLOW = new BgpTableTypeImpl(Ipv6AddressFamily.class,
+        FlowspecSubsequentAddressFamily.class);
+    private static final BgpTableType IPV4_VPN_FLOW = new BgpTableTypeImpl(Ipv4AddressFamily.class,
+        FlowspecL3vpnSubsequentAddressFamily.class);
+    private static final BgpTableType IPV6_VPN_FLOW = new BgpTableTypeImpl(Ipv6AddressFamily.class,
+        FlowspecL3vpnSubsequentAddressFamily.class);
 
     @Test
     public void testActivator() {
index 35a5526351e9ee0b9e256ff1b34e2e7825736cba..9e3899165b86e0e3ce991505640b7fb3df478c27 100644 (file)
@@ -66,7 +66,8 @@ public class FSExtendedCommunitiesTest {
 
     private static final byte[] TRAFFIC_MARKING = {(byte)128, 9, 0, 0, 0, 0, 0, 63};
 
-    private static final byte[] REDIRECT_IPV6 = {(byte)128, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2};
+    private static final byte[] REDIRECT_IPV6 =
+        {(byte)128, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2};
 
     private static final byte[] REDIRECT_AS_4BYTES = {(byte)130, 8, 0, 0, 0x19, (byte) 0x94, 0, 126};
 
@@ -85,7 +86,7 @@ public class FSExtendedCommunitiesTest {
         final SimpleFlowspecExtensionProviderContext fsContext = new SimpleFlowspecExtensionProviderContext();
         final FlowspecActivator activator = new FlowspecActivator(fsContext);
 
-        this.act= new BGPActivator(activator);
+        this.act = new BGPActivator(activator);
         final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
         this.act.start(context);
         this.registry = context.getExtendedCommunityRegistry();
@@ -98,10 +99,12 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficRateParser() throws BGPDocumentedException, BGPParsingException {
-        final TrafficRateExtendedCommunityCase trafficRate = new TrafficRateExtendedCommunityCaseBuilder().setTrafficRateExtendedCommunity(
-                new TrafficRateExtendedCommunityBuilder().setInformativeAs(new ShortAsNumber(72L))
-                        .setLocalAdministrator(new Bandwidth(new byte[] { 0, 1, 2, 3 })).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate).setTransitive(true).build();
+        final TrafficRateExtendedCommunityCase trafficRate = new TrafficRateExtendedCommunityCaseBuilder()
+                .setTrafficRateExtendedCommunity(new TrafficRateExtendedCommunityBuilder()
+                    .setInformativeAs(new ShortAsNumber(72L))
+                    .setLocalAdministrator(new Bandwidth(new byte[] { 0, 1, 2, 3 })).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate)
+                .setTransitive(true).build();
 
         final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(TRAFFIC_RATE));
         Assert.assertEquals(expected, parsed);
@@ -109,10 +112,15 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficRateSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficRateExtendedCommunityCase trafficRate = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficRateExtendedCommunityCaseBuilder().setTrafficRateExtendedCommunity(
-                new TrafficRateExtendedCommunityBuilder().setInformativeAs(new ShortAsNumber(72L))
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.TrafficRateExtendedCommunityCase trafficRate =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.TrafficRateExtendedCommunityCaseBuilder()
+                    .setTrafficRateExtendedCommunity(new TrafficRateExtendedCommunityBuilder()
+                        .setInformativeAs(new ShortAsNumber(72L))
                         .setLocalAdministrator(new Bandwidth(new byte[] { 0, 1, 2, 3 })).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(TRAFFIC_RATE.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -121,9 +129,11 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficActionParser() throws BGPDocumentedException, BGPParsingException {
-        final TrafficActionExtendedCommunityCase trafficAction = new TrafficActionExtendedCommunityCaseBuilder().setTrafficActionExtendedCommunity(
-                new TrafficActionExtendedCommunityBuilder().setSample(true).setTerminalAction(true).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficAction).setTransitive(true).build();
+        final TrafficActionExtendedCommunityCase trafficAction = new TrafficActionExtendedCommunityCaseBuilder()
+                .setTrafficActionExtendedCommunity(new TrafficActionExtendedCommunityBuilder().setSample(true)
+                    .setTerminalAction(true).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficAction)
+                .setTransitive(true).build();
 
         final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(TRAFFIC_ACTION));
         Assert.assertEquals(expected, parsed);
@@ -131,9 +141,15 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficActionSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficActionExtendedCommunityCase trafficAction = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficActionExtendedCommunityCaseBuilder().setTrafficActionExtendedCommunity(
-                new TrafficActionExtendedCommunityBuilder().setSample(true).setTerminalAction(true).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficAction).setTransitive(true).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.TrafficActionExtendedCommunityCase trafficAction =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community
+                    .TrafficActionExtendedCommunityCaseBuilder().setTrafficActionExtendedCommunity(
+                        new TrafficActionExtendedCommunityBuilder().setSample(true).setTerminalAction(true).build())
+                    .build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficAction)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(TRAFFIC_ACTION.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -142,9 +158,11 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficMarkingParser() throws BGPDocumentedException, BGPParsingException {
-        final TrafficMarkingExtendedCommunityCase trafficMarking = new TrafficMarkingExtendedCommunityCaseBuilder().setTrafficMarkingExtendedCommunity(
-                new TrafficMarkingExtendedCommunityBuilder().setGlobalAdministrator(new Dscp((short) 63)).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking).setTransitive(true).build();
+        final TrafficMarkingExtendedCommunityCase trafficMarking = new TrafficMarkingExtendedCommunityCaseBuilder()
+                .setTrafficMarkingExtendedCommunity(new TrafficMarkingExtendedCommunityBuilder()
+                    .setGlobalAdministrator(new Dscp((short) 63)).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking)
+                .setTransitive(true).build();
 
         final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(TRAFFIC_MARKING));
         Assert.assertEquals(expected, parsed);
@@ -152,9 +170,15 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testTrafficMarkingSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficMarkingExtendedCommunityCase trafficMarking = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.TrafficMarkingExtendedCommunityCaseBuilder().setTrafficMarkingExtendedCommunity(
-                new TrafficMarkingExtendedCommunityBuilder().setGlobalAdministrator(new Dscp((short) 63)).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking).setTransitive(true).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.TrafficMarkingExtendedCommunityCase trafficMarking =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community
+                    .TrafficMarkingExtendedCommunityCaseBuilder().setTrafficMarkingExtendedCommunity(
+                        new TrafficMarkingExtendedCommunityBuilder()
+                        .setGlobalAdministrator(new Dscp((short) 63)).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(TRAFFIC_MARKING.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -163,21 +187,29 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirect2bParser() throws BGPDocumentedException, BGPParsingException {
-        final RedirectExtendedCommunityCase redirect = new RedirectExtendedCommunityCaseBuilder().setRedirectExtendedCommunity(
-                new RedirectExtendedCommunityBuilder().setGlobalAdministrator(new ShortAsNumber(35L)).setLocalAdministrator(
-                        new byte[] { 4, 2, 8, 7 }).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
-
-        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_AS_2BYTES));
+        final RedirectExtendedCommunityCase redirect = new RedirectExtendedCommunityCaseBuilder()
+                .setRedirectExtendedCommunity(new RedirectExtendedCommunityBuilder()
+                    .setGlobalAdministrator(new ShortAsNumber(35L))
+                    .setLocalAdministrator(new byte[] { 4, 2, 8, 7 }).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
+
+        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(
+            Unpooled.copiedBuffer(REDIRECT_AS_2BYTES));
         Assert.assertEquals(expected, parsed);
     }
 
     @Test
     public void testredirect2bSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectExtendedCommunityCaseBuilder().setRedirectExtendedCommunity(
-                new RedirectExtendedCommunityBuilder().setGlobalAdministrator(new ShortAsNumber(35L)).setLocalAdministrator(
-                        new byte[] { 4, 2, 8, 7 }).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectExtendedCommunityCaseBuilder()
+                    .setRedirectExtendedCommunity(new RedirectExtendedCommunityBuilder()
+                        .setGlobalAdministrator(new ShortAsNumber(35L))
+                        .setLocalAdministrator(new byte[] { 4, 2, 8, 7 }).build()).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_AS_2BYTES.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -190,7 +222,8 @@ public class FSExtendedCommunitiesTest {
                 .setRedirectIpv6(new RedirectIpv6Builder()
                         .setGlobalAdministrator(new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10"))
                         .setLocalAdministrator(258).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_IPV6));
         Assert.assertEquals(expected, parsed);
@@ -198,11 +231,15 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirectIpv6Serializer() {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCaseBuilder()
-                .setRedirectIpv6(new RedirectIpv6Builder()
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCaseBuilder()
+                    .setRedirectIpv6(new RedirectIpv6Builder()
                         .setGlobalAdministrator(new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10"))
                         .setLocalAdministrator(258).build()).build();
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_IPV6.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -212,20 +249,28 @@ public class FSExtendedCommunitiesTest {
     @Test
     public void testRedirect4bParser() throws BGPDocumentedException, BGPParsingException {
         final RedirectAs4ExtendedCommunityCase redirect = new RedirectAs4ExtendedCommunityCaseBuilder().setRedirectAs4(
-                new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L)).setLocalAdministrator(126).build()).build();
+                new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L)).setLocalAdministrator(126).build())
+                .build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
-        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_AS_4BYTES));
+        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(
+            Unpooled.copiedBuffer(REDIRECT_AS_4BYTES));
         Assert.assertEquals(expected, parsed);
     }
 
     @Test
     public void testredirect4bSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCaseBuilder().setRedirectAs4(
-                new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L)).setLocalAdministrator(126).build()).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCaseBuilder()
+                    .setRedirectAs4(new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L))
+                        .setLocalAdministrator(126).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_AS_4BYTES.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -234,10 +279,12 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirectIpv4Parser() throws BGPDocumentedException, BGPParsingException {
-        final RedirectIpv4ExtendedCommunityCase redirect = new RedirectIpv4ExtendedCommunityCaseBuilder().setRedirectIpv4(
-                new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1")).setLocalAdministrator(126).build()).build();
+        final RedirectIpv4ExtendedCommunityCase redirect = new RedirectIpv4ExtendedCommunityCaseBuilder()
+                .setRedirectIpv4(new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1"))
+                    .setLocalAdministrator(126).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_IPV4));
         Assert.assertEquals(expected, parsed);
@@ -245,10 +292,15 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testredirectIpv4Serializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv4ExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv4ExtendedCommunityCaseBuilder().setRedirectIpv4(
-                new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1")).setLocalAdministrator(126).build()).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectIpv4ExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectIpv4ExtendedCommunityCaseBuilder()
+                        .setRedirectIpv4(new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1"))
+                            .setLocalAdministrator(126).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_IPV4.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -257,21 +309,29 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirectIpv4NhParser() throws BGPDocumentedException, BGPParsingException {
-        final RedirectIpNhExtendedCommunityCase redirect = new RedirectIpNhExtendedCommunityCaseBuilder().setRedirectIpNhExtendedCommunity(
-                new RedirectIpNhExtendedCommunityBuilder().setNextHopAddress(new IpAddress(new Ipv4Address("127.0.0.1"))).setCopy(true).build()).build();
+        final RedirectIpNhExtendedCommunityCase redirect = new RedirectIpNhExtendedCommunityCaseBuilder()
+                .setRedirectIpNhExtendedCommunity(new RedirectIpNhExtendedCommunityBuilder()
+                    .setNextHopAddress(new IpAddress(new Ipv4Address("127.0.0.1"))).setCopy(true).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
-        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_NH_IPV4));
+        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(
+            Unpooled.copiedBuffer(REDIRECT_NH_IPV4));
         Assert.assertEquals(expected, parsed);
     }
 
     @Test
     public void testredirectIpv4NhSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCaseBuilder().setRedirectIpNhExtendedCommunity(
-                new RedirectIpNhExtendedCommunityBuilder().setNextHopAddress(new IpAddress(new Ipv4Address("127.0.0.1"))).setCopy(true).build()).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCaseBuilder()
+                    .setRedirectIpNhExtendedCommunity(new RedirectIpNhExtendedCommunityBuilder()
+                        .setNextHopAddress(new IpAddress(new Ipv4Address("127.0.0.1"))).setCopy(true).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_NH_IPV4.length);
         this.registry.serializeExtendedCommunity(expected, output);
@@ -280,21 +340,29 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirectIpv6NhParser() throws BGPDocumentedException, BGPParsingException {
-        final RedirectIpNhExtendedCommunityCase redirect = new RedirectIpNhExtendedCommunityCaseBuilder().setRedirectIpNhExtendedCommunity(
-                new RedirectIpNhExtendedCommunityBuilder().setNextHopAddress(new IpAddress(new Ipv6Address("2001::1"))).setCopy(false).build()).build();
+        final RedirectIpNhExtendedCommunityCase redirect = new RedirectIpNhExtendedCommunityCaseBuilder()
+                .setRedirectIpNhExtendedCommunity(new RedirectIpNhExtendedCommunityBuilder()
+                    .setNextHopAddress(new IpAddress(new Ipv6Address("2001::1"))).setCopy(false).build()).build();
 
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
-        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_NH_IPV6));
+        final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(
+            Unpooled.copiedBuffer(REDIRECT_NH_IPV6));
         Assert.assertEquals(expected, parsed);
     }
 
     @Test
     public void testredirectIpv6NhSerializer() throws BGPDocumentedException, BGPParsingException {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCaseBuilder().setRedirectIpNhExtendedCommunity(
-                new RedirectIpNhExtendedCommunityBuilder().setNextHopAddress(new IpAddress(new Ipv6Address("2001::1"))).build()).build();
-
-        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib.route
+            .attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCase redirect =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
+                    .route.attributes.extended.communities.extended.community.RedirectIpNhExtendedCommunityCaseBuilder()
+                    .setRedirectIpNhExtendedCommunity(new RedirectIpNhExtendedCommunityBuilder()
+                        .setNextHopAddress(new IpAddress(new Ipv6Address("2001::1"))).build()).build();
+
+        final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
+                .setTransitive(true).build();
 
         final ByteBuf output = Unpooled.buffer(REDIRECT_NH_IPV6.length);
         this.registry.serializeExtendedCommunity(expected, output);
index 031da45c74b0c788d4fa91bf559d9479ea266871..d98b610bb21917b74732d4f9dc9c66b4caeb2c86 100644 (file)
@@ -23,9 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow
 
 public class NumericOperandParserTest {
     private static final byte[] ONE_BYTE_CODE_LIST = new byte[]{
-            0x01, 0x64,
-            0x01, 0x65,
-            (byte) 0x81, 0x66,    // last port in the list should have end-of-list set
+        0x01, 0x64,
+        0x01, 0x65,
+        (byte) 0x81, 0x66,    // last port in the list should have end-of-list set
     };
 
     @Test