Fix checkstyle violations in openflowjava extensions 93/67793/4
authorTom Pantelis <tompantelis@gmail.com>
Wed, 31 Jan 2018 14:50:09 +0000 (09:50 -0500)
committerAnil Vishnoi <vishnoianil@gmail.com>
Thu, 15 Feb 2018 10:29:45 +0000 (10:29 +0000)
Change-Id: Ie4a01ec30e1feb054bfceb52a2598a2936264ace
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
94 files changed:
extension/openflowjava-extension-nicira-api/src/main/java/org/opendaylight/openflowjava/nx/api/NiciraActionDeserializerKey.java
extension/openflowjava-extension-nicira-api/src/main/java/org/opendaylight/openflowjava/nx/api/NiciraActionSerializerKey.java
extension/openflowjava-extension-nicira-api/src/main/java/org/opendaylight/openflowjava/nx/api/NiciraExtensionCodecRegistrator.java
extension/openflowjava-extension-nicira-api/src/main/java/org/opendaylight/openflowjava/nx/api/NiciraUtil.java
extension/openflowjava-extension-nicira-api/src/test/java/org/opendaylight/openflowjava/nx/api/NiciraActionDeserializerKeyTest.java
extension/openflowjava-extension-nicira-api/src/test/java/org/opendaylight/openflowjava/nx/api/NiciraActionSerializerKeyTest.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraExtensionCodecRegistratorImpl.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraExtensionsRegistrator.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/AbstractActionCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ActionDeserializer.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/FinTimeoutCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/LearnCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/LearnCodecUtil.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/MultipathCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/NiciraActionCodecs.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/OutputRegCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/PopNshCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/PushNshCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/RegLoadCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/RegMoveCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ResubmitCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/AbstractMatchCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/CtMarkCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/CtStateCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/CtZoneCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EncapEthDstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EncapEthSrcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EncapEthTypeCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/IcmpTypeCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/InPortCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/IpDstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/IpSrcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/Ipv6DstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/Ipv6SrcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/MplsLabelCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NiciraMatchCodecs.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NshMdtypeCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NxmHeader.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TcpDstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TcpSrcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TunGpeNpCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TunIpv4DstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TunIpv4SrcCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/UdpDstCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/UdpSrcCodec.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/NiciraExtensionCodecRegistratorImplTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/NiciraExtensionsRegistratorTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ActionDeserializerTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/FinTimeoutCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/LearnCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/MultipathCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/OutputRegCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/RegLoadCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/RegMoveCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ResubmitCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpOpCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpSpaCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpTpaCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/CtStateCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/CtZoneCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthTypeCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/IcmpTypeCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/IpDstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/IpSrcCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Ipv6DstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Ipv6SrcCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Nshc1CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Nshc2CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Nshc3CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Nshc4CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/NsiCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/NspCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/NxmHeaderTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg0CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg1CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg2CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg3CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg4CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg5CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg6CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/Reg7CodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/TcpDstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/TcpSrcCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/TunIdCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/TunIpv4DstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/TunIpv4SrcCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/UdpDstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/UdpSrcCodecTest.java

index eb7146ad950a9539deeeab9c80e0d5cf76b87d86..9aaf05bae86fc745cab92de0c40293c85d068b44 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -8,8 +8,9 @@
 package org.opendaylight.openflowjava.nx.api;
 
 /**
- * @author msunal
+ * Deserializer key for a Nicira action.
  *
+ * @author msunal
  */
 public final class NiciraActionDeserializerKey {
 
@@ -17,6 +18,8 @@ public final class NiciraActionDeserializerKey {
     private final int subtype;
 
     /**
+     * Contructor.
+     *
      * @param version protocol wire version
      * @param subtype nx_action_subtype
      */
@@ -37,7 +40,7 @@ public final class NiciraActionDeserializerKey {
         return subtype;
     }
 
-    private static final boolean isValueUint16(int value) {
+    private static boolean isValueUint16(int value) {
         if (value >= 0 && value <= 65535L) {
             return true;
         }
index f2f86461286f526da6cb8b5badfd1c42a8ba02f5..780a9ead21490887c5aeaa48fa82450f1406f7f6 100644 (file)
@@ -10,8 +10,9 @@ package org.opendaylight.openflowjava.nx.api;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 
 /**
- * @author msunal
+ * Serializer key for a Nicira action.
  *
+ * @author msunal
  */
 public class NiciraActionSerializerKey {
 
@@ -19,6 +20,8 @@ public class NiciraActionSerializerKey {
     private final Class<? extends ActionChoice> subtype;
 
     /**
+     * Contructor.
+     *
      * @param version protocol wire version
      * @param subtype nx_action_subtype
      */
@@ -39,7 +42,7 @@ public class NiciraActionSerializerKey {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((subtype == null) ? 0 : subtype.hashCode());
+        result = prime * result + (subtype == null ? 0 : subtype.hashCode());
         result = prime * result + version;
         return result;
     }
index afe59ba80fa198be2fdb119f76e180a7faa8fc97..63f44ce4ea6e583949b0c1b986d9900c45a8de2a 100644 (file)
@@ -17,8 +17,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmC
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 
 /**
- * @author msunal
+ * Registry for Nicira extension codecs.
  *
+ * @author msunal
  */
 public interface NiciraExtensionCodecRegistrator extends AutoCloseable {
 
index 48f54036eddbac85fccb997592dc6781ddb223e7..271bce199805e8c6a577d4314980af1e07f271d9 100644 (file)
@@ -10,12 +10,14 @@ package org.opendaylight.openflowjava.nx.api;
 import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
 
 /**
+ * Nicira utilities.
+ *
  * @author msunal
  */
 public final class NiciraUtil {
     private NiciraUtil() { }
 
-    public static final ActionSerializerKey<?> createOfJavaKeyFrom(NiciraActionSerializerKey key) {
+    public static ActionSerializerKey<?> createOfJavaKeyFrom(NiciraActionSerializerKey key) {
         return new ActionSerializerKey<>(key.getVersion(), key.getSubtype(), NiciraConstants.NX_VENDOR_ID);
     }
 
index fbb14aeb35bb014e79d2a8911a5cd8b09101e780..071ebb2ec21fa658ed66c1bd665022ca19d49d4a 100644 (file)
@@ -22,7 +22,7 @@ public class NiciraActionDeserializerKeyTest {
 
 
     /**
-     * If SUBTYPE is not Uint16 exception should be thrown
+     * If SUBTYPE is not Uint16 exception should be thrown.
      */
     @Test(expected = IllegalArgumentException.class)
     public void niciraActionDeserializerKeyTest1() {
@@ -30,7 +30,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If SUBTYPE is Uint16 it should be set and version should be set also
+     * If SUBTYPE is Uint16 it should be set and version should be set also.
      */
     @Test
     public void niciraActionDeserializerKeyTest2() {
@@ -47,7 +47,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is null FALSE should be returned
+     * If input param obj is null FALSE should be returned.
      */
     @Test
     public void equalsTest1() {
@@ -58,7 +58,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is NOT null but is different class FALSE should be returned
+     * If input param obj is NOT null but is different class FALSE should be returned.
      */
     @Test
     public void equalsTest2() {
@@ -69,7 +69,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is same class but has different SUBTYPE value FALSE should be returned
+     * If input param obj is same class but has different SUBTYPE value FALSE should be returned.
      */
     @Test
     public void equalsTest3() {
@@ -80,7 +80,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is same class but has different VERSION value FALSE should be returned
+     * If input param obj is same class but has different VERSION value FALSE should be returned.
      */
     @Test
     public void equalsTest4() {
@@ -91,7 +91,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is absolutely same TRUE should be returned
+     * If input param obj is absolutely same TRUE should be returned.
      */
     @Test
     public void equalsTest5() {
@@ -102,7 +102,7 @@ public class NiciraActionDeserializerKeyTest {
     }
 
     /**
-     * If input param obj is same instance TRUE should be returned
+     * If input param obj is same instance TRUE should be returned.
      */
     @Test
     public void equalsTest6() {
@@ -119,4 +119,4 @@ public class NiciraActionDeserializerKeyTest {
         assertEquals(shouldBe, niciraActionDeserializerKey.toString());
     }
 
-}
\ No newline at end of file
+}
index 25425fd100e43a7f986fe478b4f5755559fdbd2f..4ae943b0c74bda66335d549894e3e3a2cf985dc1 100644 (file)
@@ -33,7 +33,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is NULL then FALSE should be returned
+     * If input param obj is NULL then FALSE should be returned.
      */
     @Test
     public void equalsTest1() {
@@ -44,7 +44,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is NOT NULL but is instance of different class then FALSE should be returned
+     * If input param obj is NOT NULL but is instance of different class then FALSE should be returned.
      */
     @Test
     public void equalsTest2() {
@@ -55,7 +55,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is instance of the same class but this.subtype is NULL then FALSE should be returned
+     * If input param obj is instance of the same class but this.subtype is NULL then FALSE should be returned.
      */
     @Test
     public void equalsTest3() {
@@ -66,7 +66,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is instance of the same class but has different SUBTYPE then FALSE should be returned
+     * If input param obj is instance of the same class but has different SUBTYPE then FALSE should be returned.
      */
     @Test
     public void equalsTest4() {
@@ -77,7 +77,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is instance of the same class but has different VERSION then FALSE should be returned
+     * If input param obj is instance of the same class but has different VERSION then FALSE should be returned.
      */
     @Test
     public void equalsTest5() {
@@ -88,7 +88,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is instance of the same class and has same VERSION and SUBTYPE then TRUE should be returned
+     * If input param obj is instance of the same class and has same VERSION and SUBTYPE then TRUE should be returned.
      */
     @Test
     public void equalsTest6() {
@@ -99,7 +99,7 @@ public class NiciraActionSerializerKeyTest {
     }
 
     /**
-     * If input param obj is exactly same TRUE should be returned
+     * If input param obj is exactly same TRUE should be returned.
      */
     @Test
     public void equalsTest7() {
@@ -113,4 +113,4 @@ public class NiciraActionSerializerKeyTest {
     private interface SubtypeClass extends ActionChoice {}
 
 
-}
\ No newline at end of file
+}
index c445edad505708b76a3609fdacea096ec6f4749a..1dccca2e40a76110cd8809f76814d4883ad21beb 100644 (file)
@@ -34,18 +34,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmC
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 
 /**
- * @author msunal
+ * Implementation of NiciraExtensionCodecRegistrator.
  *
+ * @author msunal
  */
 public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodecRegistrator {
 
-    private static final Map<NiciraActionDeserializerKey, OFDeserializer<Action>> actionDeserializers = new ConcurrentHashMap<>();
+    private static final Map<NiciraActionDeserializerKey, OFDeserializer<Action>> ACTION_DESERIALIZERS =
+            new ConcurrentHashMap<>();
 
     private final List<SwitchConnectionProvider> providers;
 
-    /**
-     * @param providers
-     */
     public NiciraExtensionCodecRegistratorImpl(List<SwitchConnectionProvider> providers) {
         this.providers = providers;
         ActionDeserializer of10ActionDeserializer = new ActionDeserializer(EncodeConstants.OF10_VERSION_ID);
@@ -60,24 +59,6 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
         }
     }
 
-    private void registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer) {
-        for (SwitchConnectionProvider provider : providers) {
-            provider.registerActionSerializer(key, serializer);
-        }
-    }
-
-    private void unregisterDeserializer(ExperimenterDeserializerKey key) {
-        for (SwitchConnectionProvider provider : providers) {
-            provider.unregisterDeserializer(key);
-        }
-    }
-
-    private void unregisterSerializer(ExperimenterSerializerKey key) {
-        for (SwitchConnectionProvider provider : providers) {
-            provider.unregisterSerializer(key);
-        }
-    }
-
     /*
      * (non-Javadoc)
      *
@@ -89,7 +70,13 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
      */
     @Override
     public void registerActionDeserializer(NiciraActionDeserializerKey key, OFDeserializer<Action> deserializer) {
-        actionDeserializers.put(key, deserializer);
+        ACTION_DESERIALIZERS.put(key, deserializer);
+    }
+
+    private void registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer) {
+        for (SwitchConnectionProvider provider : providers) {
+            provider.registerActionSerializer(key, serializer);
+        }
     }
 
     /*
@@ -97,16 +84,25 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
      *
      * @see org.opendaylight.openflow.extension.nicira.api.
      * NiciraExtensionCodecRegistrator
-     * #unregisterActionDeserializer(org.opendaylight
-     * .openflow.extension.nicira.api.NiciraActionDeserializerKey)
+     * #registerActionSerializer(org.opendaylight.
+     * openflow.extension.nicira.api.NiciraActionSerializerKey,
+     * org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer)
      */
     @Override
-    public void unregisterActionDeserializer(NiciraActionDeserializerKey key) {
-        actionDeserializers.remove(key);
+    public void registerActionSerializer(NiciraActionSerializerKey key, OFSerializer<Action> serializer) {
+        registerActionSerializer(NiciraUtil.createOfJavaKeyFrom(key), serializer);
     }
 
-    public static OFDeserializer<Action> getActionDeserializer(NiciraActionDeserializerKey key) {
-        return actionDeserializers.get(key);
+    private void unregisterDeserializer(ExperimenterDeserializerKey key) {
+        for (SwitchConnectionProvider provider : providers) {
+            provider.unregisterDeserializer(key);
+        }
+    }
+
+    private void unregisterSerializer(ExperimenterSerializerKey key) {
+        for (SwitchConnectionProvider provider : providers) {
+            provider.unregisterSerializer(key);
+        }
     }
 
     /*
@@ -114,13 +110,16 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
      *
      * @see org.opendaylight.openflow.extension.nicira.api.
      * NiciraExtensionCodecRegistrator
-     * #registerActionSerializer(org.opendaylight.
-     * openflow.extension.nicira.api.NiciraActionSerializerKey,
-     * org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer)
+     * #unregisterActionDeserializer(org.opendaylight
+     * .openflow.extension.nicira.api.NiciraActionDeserializerKey)
      */
     @Override
-    public void registerActionSerializer(NiciraActionSerializerKey key, OFSerializer<Action> serializer) {
-        registerActionSerializer(NiciraUtil.createOfJavaKeyFrom(key), serializer);
+    public void unregisterActionDeserializer(NiciraActionDeserializerKey key) {
+        ACTION_DESERIALIZERS.remove(key);
+    }
+
+    public static OFDeserializer<Action> getActionDeserializer(NiciraActionDeserializerKey key) {
+        return ACTION_DESERIALIZERS.get(key);
     }
 
     /*
@@ -191,7 +190,8 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
      * .openflowjava.protocol.api.keys.MatchEntrySerializerKey)
      */
     @Override
-    public void unregisterMatchEntrySerializer(MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key) {
+    public void unregisterMatchEntrySerializer(
+            MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key) {
         unregisterSerializer(key);
     }
 
@@ -202,7 +202,7 @@ public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodec
 
     @VisibleForTesting
     boolean isEmptyActionDeserializers() {
-        return actionDeserializers.isEmpty();
+        return ACTION_DESERIALIZERS.isEmpty();
     }
 
 }
index 29fe00fe47591716dc04da27a3b63e9ff6ae728a..d25f8ff3431a954372d886a8da8c40584b9d68c4 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.openflowjava.nx;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
 import org.opendaylight.openflowjava.nx.codec.action.ConntrackCodec;
 import org.opendaylight.openflowjava.nx.codec.action.FinTimeoutCodec;
@@ -15,11 +16,11 @@ import org.opendaylight.openflowjava.nx.codec.action.LearnCodec;
 import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
 import org.opendaylight.openflowjava.nx.codec.action.NiciraActionCodecs;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
 import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
@@ -28,22 +29,23 @@ import org.opendaylight.openflowjava.nx.codec.match.ArpTpaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtMarkCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtStateCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtZoneCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthTypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
+import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
 import org.opendaylight.openflowjava.nx.codec.match.NiciraMatchCodecs;
+import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc1Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc2Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc3Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc4Codec;
 import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
 import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
-import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg0Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg1Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg2Codec;
@@ -54,15 +56,12 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg6Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
 import org.opendaylight.openflowjava.nx.codec.match.TcpDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.UdpDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
-import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
-
-import com.google.common.base.Preconditions;
 
 public class NiciraExtensionsRegistrator implements AutoCloseable {
     private final NiciraExtensionCodecRegistrator registrator;
index 01a9c1f2cbbfc421fb08eb4aacc560a39adbc4ab..e4ffc19e287ea1e972c62a3eb47fcdbbfa89ae7b 100644 (file)
@@ -17,6 +17,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
 
 /**
+ * Base class for an action codec.
+ *
  * @author msunal
  */
 public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDeserializer<Action> {
@@ -26,7 +28,8 @@ public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDes
         writeMsgLengthVendorIdSubtypeToBuffer(msgLength, subtype, outBuffer);
     }
 
-    private static final void writeMsgLengthVendorIdSubtypeToBuffer(final int msgLength, final int subtype, final ByteBuf outBuffer) {
+    private static void writeMsgLengthVendorIdSubtypeToBuffer(final int msgLength, final int subtype,
+            final ByteBuf outBuffer) {
         outBuffer.writeShort(msgLength);
         outBuffer.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
         outBuffer.writeShort(subtype);
@@ -46,7 +49,7 @@ public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDes
         return actionBuilder;
     }
 
-    protected static final ExperimenterId getExperimenterId(){
+    protected static final ExperimenterId getExperimenterId() {
         return new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
     }
 
index 4b353e4bfb0efec5eab20af9309ad58b0d4b8807..34db9d34bcbbb6c7be2d90a877b1032c2ebf2fe2 100644 (file)
@@ -9,10 +9,9 @@
 package org.opendaylight.openflowjava.nx.codec.action;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.nx.NiciraExtensionCodecRegistratorImpl;
 import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
-import org.opendaylight.openflowjava.nx.NiciraExtensionCodecRegistratorImpl;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -32,6 +31,8 @@ public class ActionDeserializer implements OFDeserializer<Action> {
     private final short version;
 
     /**
+     * Constructor.
+     *
      * @param version protocol wire version
      */
     public ActionDeserializer(short version) {
@@ -40,7 +41,7 @@ public class ActionDeserializer implements OFDeserializer<Action> {
 
     @Override
     public Action deserialize(ByteBuf message) {
-        int startPossition = message.readerIndex();
+        final int startPosition = message.readerIndex();
         // size of experimenter type
         message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
         // size of length
@@ -56,7 +57,8 @@ public class ActionDeserializer implements OFDeserializer<Action> {
             LOG.info("No deserializer was found for key {}", key);
             return null;
         }
-        message.readerIndex(startPossition);
+
+        message.readerIndex(startPosition);
         return actionDeserializer.deserialize(message);
     }
 
index 624b0248994dca95388cf69b54cce8ecba28b807..b86222c58d22362ed81e425de05c9298b99b6479 100644 (file)
@@ -8,12 +8,11 @@
 
 package org.opendaylight.openflowjava.nx.codec.action;
 
+import com.google.common.net.InetAddresses;
 import io.netty.buffer.ByteBuf;
-
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -28,22 +27,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMark;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNatBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.net.InetAddresses;
-
 /**
+ * Action codec for conntrack.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class ConntrackCodec extends AbstractActionCodec {
     private static final Logger LOG = LoggerFactory.getLogger(ConntrackCodec.class);
     public static final int CT_LENGTH = 24;
@@ -89,7 +87,7 @@ public class ConntrackCodec extends AbstractActionCodec {
                 NxActionNatCase nxActionNatCase = (NxActionNatCase)ctActions.getOfpactActions();
                 NxActionNat natAction = nxActionNatCase.getNxActionNat();
                 int natLength = getNatActionLength(natAction);
-                int pad = 8 - (natLength % 8);
+                int pad = 8 - natLength % 8;
                 length += natLength + pad;
             } else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase) {
                 length += SET_FIELD_LENGTH;
@@ -122,11 +120,11 @@ public class ConntrackCodec extends AbstractActionCodec {
         List<CtActions> ctActionsList = action.getNxActionConntrack().getCtActions();
         if (ctActionsList != null) {
             for (CtActions ctActions : ctActionsList) {
-                if (ctActions.getOfpactActions() instanceof NxActionNatCase){
+                if (ctActions.getOfpactActions() instanceof NxActionNatCase) {
                     NxActionNatCase nxActionNatCase = (NxActionNatCase)ctActions.getOfpactActions();
                     NxActionNat natAction = nxActionNatCase.getNxActionNat();
                     int natLength = getNatActionLength(natAction);
-                    int pad = 8 - (natLength % 8);
+                    int pad = 8 - natLength % 8;
                     serializeHeader(natLength + pad, NXAST_NAT_SUBTYPE, outBuffer);
                     outBuffer.writeZero(2);
                     outBuffer.writeShort(natAction.getFlags().shortValue());
@@ -151,7 +149,7 @@ public class ConntrackCodec extends AbstractActionCodec {
                         outBuffer.writeShort(natAction.getPortMax());
                     }
                     outBuffer.writeZero(pad);
-                } else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase){
+                } else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase) {
                     NxActionCtMarkCase nxActionCtMarkCase = (NxActionCtMarkCase)ctActions.getOfpactActions();
                     NxActionCtMark ctMarkAction = nxActionCtMarkCase.getNxActionCtMark();
 
@@ -179,13 +177,14 @@ public class ConntrackCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        short length = deserializeCtHeader(message);
+        final short length = deserializeCtHeader(message);
         NxActionConntrackBuilder nxActionConntrackBuilder = new NxActionConntrackBuilder();
         nxActionConntrackBuilder.setFlags(message.readUnsignedShort());
         nxActionConntrackBuilder.setZoneSrc(message.readUnsignedInt());
         nxActionConntrackBuilder.setConntrackZone(message.readUnsignedShort());
         nxActionConntrackBuilder.setRecircTable(message.readUnsignedByte());
         message.skipBytes(5);
+
         if  (length > CT_LENGTH) {
             deserializeCtAction(message,nxActionConntrackBuilder, length - CT_LENGTH);
         }
@@ -202,7 +201,7 @@ public class ConntrackCodec extends AbstractActionCodec {
         List<CtActions> ctActionsList = new ArrayList<>();
         int processedCtActionsLength = ctActionsLength;
 
-        while (processedCtActionsLength > 0){
+        while (processedCtActionsLength > 0) {
             int startReaderIndex = message.readerIndex();
 
             if (EncodeConstants.EXPERIMENTER_VALUE == message.readUnsignedShort()) {
@@ -210,7 +209,7 @@ public class ConntrackCodec extends AbstractActionCodec {
                 // reset indices
                 message.setIndex(startReaderIndex, message.writerIndex());
 
-                int startIndex = message.readerIndex();
+                final int startIndex = message.readerIndex();
                 int length = deserializeCtHeader(message);
 
                 processedCtActionsLength = processedCtActionsLength - length;
index 1ec82331a5376d9501d23043be97d76ab330758e..e07052231099242294b71c161808d49028b7caa0 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder;
 
 /**
- * Codec for the NX_FIN_TIMEOUT
+ * Codec for the NX_FIN_TIMEOUT.
  */
 public class FinTimeoutCodec extends AbstractActionCodec {
 
@@ -38,7 +38,7 @@ public class FinTimeoutCodec extends AbstractActionCodec {
         short idleTimeOut = OFP_NO_TIMEOUT;
         short hardTimeOut = OFP_NO_TIMEOUT;
 
-        ActionFinTimeout action = ((ActionFinTimeout) input.getActionChoice());
+        ActionFinTimeout action = (ActionFinTimeout) input.getActionChoice();
         serializeHeader(LENGTH, NXAST_FIN_TIMEOUT_SUBTYPE, outBuffer);
 
         if (action.getNxActionFinTimeout().getFinIdleTimeout() != null) {
@@ -54,7 +54,7 @@ public class FinTimeoutCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionBuilder actionBuilder = deserializeHeader(message);
 
         ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
         NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
index b76bf619839ac3cba99f231a498beb160b9169fb..fe29a2297eee8ecdeaebb7710f8e5fc883ee57c6 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.action;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
@@ -22,9 +21,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder;
 
 /**
+ * Codec for the learn action.
+ *
  * @author Slava Radune
  */
-
 public class LearnCodec extends AbstractActionCodec {
     public static final byte NXAST_LEARN_SUBTYPE = 16;
     public static final NiciraActionSerializerKey SERIALIZER_KEY =
@@ -38,16 +38,16 @@ public class LearnCodec extends AbstractActionCodec {
         ActionLearn action = (ActionLearn) input.getActionChoice();
         int length = LearnCodecUtil.calcLength(action);
         int lengthMod = length % MUL_LENGTH;
-        if(lengthMod != 0){
+        if (lengthMod != 0) {
             lengthMod = MUL_LENGTH - lengthMod;
         }
-        serializeHeader(length+lengthMod, NXAST_LEARN_SUBTYPE, outBuffer);
+        serializeHeader(length + lengthMod, NXAST_LEARN_SUBTYPE, outBuffer);
 
         LearnCodecUtil.serializeLearnHeader(outBuffer, action);
         LearnCodecUtil.serializeFlowMods(outBuffer, action);
 
         //pad with zeros for the length to be multiplication by 8
-        if(lengthMod != 0){
+        if (lengthMod != 0) {
             outBuffer.writeZero(lengthMod);
         }
 
@@ -59,7 +59,7 @@ public class LearnCodec extends AbstractActionCodec {
         actionBuilder.setExperimenterId(new ExperimenterId(NiciraConstants.NX_VENDOR_ID));
 
         short length = LearnCodecUtil.deserializeHeader(message);
-        ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
+        final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
 
         NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
         LearnCodecUtil.deserializeLearnHeader(message, nxActionLearnBuilder);
@@ -74,5 +74,4 @@ public class LearnCodec extends AbstractActionCodec {
 
         return actionBuilder.build();
     }
-
 }
index b6edbe0d545a64cfaa80e2c2d53c5f6325f1f0e1..3da7e8a86bfc5ba6bcfd473464ad73be8161cfff 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.openflowjava.nx.codec.action;
 
+import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-
-import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase;
@@ -41,7 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class LearnCodecUtil {
+public final class LearnCodecUtil {
 
     private static final Logger LOG = LoggerFactory.getLogger(LearnCodecUtil.class);
     public static final int HEADER_LENGTH = 32;
@@ -56,17 +54,19 @@ public class LearnCodecUtil {
     private static final int EMPTY_FLOW_MOD_LENGTH = 2;
     private static short length;
 
+    private LearnCodecUtil() {
+    }
 
     static short deserializeHeader(ByteBuf message) {
         // size of experimenter type
         message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
         // size of length
-        short length = message.readShort();
+        short messageLength = message.readShort();
         // vendor id
         message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
         // subtype
         message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        return length;
+        return messageLength;
     }
 
     /*
@@ -86,39 +86,44 @@ public class LearnCodecUtil {
     }
 
     static void serializeFlowMods(final ByteBuf outBuffer, ActionLearn action) {
-        if(action.getNxActionLearn().getFlowMods() != null){
-            for(FlowMods flowMod : action.getNxActionLearn().getFlowMods()){
-                if(flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase){
-                    FlowModAddMatchFromField flowModSpecFromField = ((FlowModAddMatchFromFieldCase)flowMod.getFlowModSpec()).getFlowModAddMatchFromField();
+        if (action.getNxActionLearn().getFlowMods() != null) {
+            for (FlowMods flowMod : action.getNxActionLearn().getFlowMods()) {
+                if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase) {
+                    FlowModAddMatchFromField flowModSpecFromField = ((FlowModAddMatchFromFieldCase) flowMod
+                            .getFlowModSpec()).getFlowModAddMatchFromField();
                     toFlowModSpecHeader(flowModSpecFromField, outBuffer);
                     outBuffer.writeInt(flowModSpecFromField.getSrcField().intValue());
                     outBuffer.writeShort(flowModSpecFromField.getSrcOfs().shortValue());
                     outBuffer.writeInt(flowModSpecFromField.getDstField().intValue());
                     outBuffer.writeShort(flowModSpecFromField.getDstOfs().shortValue());
-                }else if( flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase){
-                    FlowModAddMatchFromValue flowModSpec = ((FlowModAddMatchFromValueCase)flowMod.getFlowModSpec()).getFlowModAddMatchFromValue();
+                } else if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase) {
+                    FlowModAddMatchFromValue flowModSpec = ((FlowModAddMatchFromValueCase) flowMod.getFlowModSpec())
+                            .getFlowModAddMatchFromValue();
                     toFlowModSpecHeader(flowModSpec, outBuffer);
                     outBuffer.writeShort(flowModSpec.getValue().shortValue());
                     outBuffer.writeInt(flowModSpec.getSrcField().intValue());
                     outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
 
-                }else if( flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase){
-                    FlowModCopyFieldIntoField flowModSpec = ((FlowModCopyFieldIntoFieldCase)flowMod.getFlowModSpec()).getFlowModCopyFieldIntoField();
+                } else if (flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase) {
+                    FlowModCopyFieldIntoField flowModSpec = ((FlowModCopyFieldIntoFieldCase) flowMod.getFlowModSpec())
+                            .getFlowModCopyFieldIntoField();
                     toFlowModSpecHeader(flowModSpec, outBuffer);
                     outBuffer.writeInt(flowModSpec.getSrcField().intValue());
                     outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
                     outBuffer.writeInt(flowModSpec.getDstField().intValue());
                     outBuffer.writeShort(flowModSpec.getDstOfs().shortValue());
 
-                }else if( flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase){
-                    FlowModCopyValueIntoField flowModSpec = ((FlowModCopyValueIntoFieldCase)flowMod.getFlowModSpec()).getFlowModCopyValueIntoField();
+                } else if (flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase) {
+                    FlowModCopyValueIntoField flowModSpec = ((FlowModCopyValueIntoFieldCase) flowMod.getFlowModSpec())
+                            .getFlowModCopyValueIntoField();
                     toFlowModSpecHeader(flowModSpec, outBuffer);
                     outBuffer.writeShort(flowModSpec.getValue().shortValue());
                     outBuffer.writeInt(flowModSpec.getDstField().intValue());
                     outBuffer.writeShort(flowModSpec.getDstOfs().shortValue());
 
-                }else if( flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase){
-                    FlowModOutputToPort flowModSpec = ((FlowModOutputToPortCase)flowMod.getFlowModSpec()).getFlowModOutputToPort();
+                } else if (flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase) {
+                    FlowModOutputToPort flowModSpec = ((FlowModOutputToPortCase) flowMod.getFlowModSpec())
+                            .getFlowModOutputToPort();
                     toFlowModSpecHeader(flowModSpec, outBuffer);
                     outBuffer.writeInt(flowModSpec.getSrcField().intValue());
                     outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
@@ -148,33 +153,33 @@ public class LearnCodecUtil {
     }
 
     private static void serializeFlowModSpecHeader(int src, int dst, short bitNum, ByteBuf outBuffer) {
-        short s = 0;
-        s |= (src << SRC_POS);
-        s |= (dst << DST_POS);
-        s |= bitNum;
-        outBuffer.writeShort(s);
+        short value = 0;
+        value |= src << SRC_POS;
+        value |= dst << DST_POS;
+        value |= bitNum;
+        outBuffer.writeShort(value);
     }
 
     static int calcLength(ActionLearn action) {
-        int length = HEADER_LENGTH;
-        if(action.getNxActionLearn().getFlowMods() == null){
-            return length;
+        int actionLength = HEADER_LENGTH;
+        if (action.getNxActionLearn().getFlowMods() == null) {
+            return actionLength;
         }
-        for(FlowMods flowMod : action.getNxActionLearn().getFlowMods()){
-            if(flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase){
-                length += FROM_FIELD_LENGTH;
-            } else if( flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase){
-                length += FROM_VALUE_LENGTH;
-            } else if( flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase){
-                length += FROM_FIELD_LENGTH;
-            } else if( flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase){
-                length += FROM_VALUE_LENGTH;
-            } else if( flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase){
-                length += TO_PORT_LENGTH;
+        for (FlowMods flowMod : action.getNxActionLearn().getFlowMods()) {
+            if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase) {
+                actionLength += FROM_FIELD_LENGTH;
+            } else if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase) {
+                actionLength += FROM_VALUE_LENGTH;
+            } else if (flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase) {
+                actionLength += FROM_FIELD_LENGTH;
+            } else if (flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase) {
+                actionLength += FROM_VALUE_LENGTH;
+            } else if (flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase) {
+                actionLength += TO_PORT_LENGTH;
             }
         }
 
-        return length;
+        return actionLength;
     }
 
     /*
@@ -193,22 +198,24 @@ public class LearnCodecUtil {
         nxActionLearnBuilder.setFinHardTimeout(message.readUnsignedShort());
     }
 
-    static synchronized void buildFlowModSpecs(NxActionLearnBuilder nxActionLearnBuilder, ByteBuf message, short length) {
-        LearnCodecUtil.length = length;
-        List<FlowMods> flowModeList = new ArrayList<FlowMods>();
+    static synchronized void buildFlowModSpecs(NxActionLearnBuilder nxActionLearnBuilder, ByteBuf message,
+            short messageLength) {
+        LearnCodecUtil.length = messageLength;
+        List<FlowMods> flowModeList = new ArrayList<>();
 
-        while(LearnCodecUtil.length > 0){
+        while (LearnCodecUtil.length > 0) {
             FlowMods flowMod = readFlowMod(message);
 
-            if(flowMod != null){
+            if (flowMod != null) {
                 flowModeList.add(flowMod);
-            }else{
+            } else {
                 LOG.trace("skipping padding bytes");
             }
         }
 
-        if(LearnCodecUtil.length != 0){
-            LOG.error("Learn Codec read " + Math.abs(length) + " bytes more than needed from stream. Packet might be corrupted");
+        if (LearnCodecUtil.length != 0) {
+            LOG.error("Learn Codec read " + Math.abs(messageLength)
+                    + " bytes more than needed from stream. Packet might be corrupted");
         }
         nxActionLearnBuilder.setFlowMods(flowModeList);
     }
@@ -216,7 +223,7 @@ public class LearnCodecUtil {
     private static FlowMods readFlowMod(ByteBuf message) {
         short header = message.readShort();
         length -= EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
-        if(header == 0){
+        if (header == 0) {
             return null;
         }
 
@@ -224,18 +231,18 @@ public class LearnCodecUtil {
         short dst = (short) ((header & DST_MASK) >> DST_POS);
         short numBits = (short) (header & NUM_BITS_MASK);
 
-        if(src == 0 && dst == 0 && numBits != 0){
+        if (src == 0 && dst == 0 && numBits != 0) {
             return readFlowModAddMatchFromField(message, numBits);
-        } else if(src == 0 && dst == 0){
+        } else if (src == 0 && dst == 0) {
             message.skipBytes(EMPTY_FLOW_MOD_LENGTH);
             length -= EMPTY_FLOW_MOD_LENGTH;
-        } else if(src == 1 && dst == 0){
+        } else if (src == 1 && dst == 0) {
             return readFlowModAddMatchFromValue(message, numBits);
-        } else if(src == 0 && dst == 1){
+        } else if (src == 0 && dst == 1) {
             return readFlowModCopyFromField(message, numBits);
-        } else if(src == 1 && dst == 1){
+        } else if (src == 1 && dst == 1) {
             return readFlowModCopyFromValue(message, numBits);
-        } else if(src == 0 && dst == 2){
+        } else if (src == 0 && dst == 2) {
             return readFlowToPort(message, numBits);
         }
         return null;
@@ -261,7 +268,7 @@ public class LearnCodecUtil {
 
     private static FlowMods readFlowModAddMatchFromValue(ByteBuf message, short numBits) {
         FlowModAddMatchFromValueBuilder builder = new FlowModAddMatchFromValueBuilder();
-        builder.setValue((int) message.readUnsignedShort());
+        builder.setValue(message.readUnsignedShort());
         builder.setSrcField((long) message.readInt());
         builder.setSrcOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
@@ -292,7 +299,7 @@ public class LearnCodecUtil {
 
     private static FlowMods readFlowModCopyFromValue(ByteBuf message, short numBits) {
         FlowModCopyValueIntoFieldBuilder builder = new FlowModCopyValueIntoFieldBuilder();
-        builder.setValue((int) message.readUnsignedShort());
+        builder.setValue(message.readUnsignedShort());
         builder.setDstField((long) message.readInt());
         builder.setDstOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
@@ -318,6 +325,4 @@ public class LearnCodecUtil {
         flowModsBuilder.setFlowModSpec(caseBuilder.build());
         return flowModsBuilder.build();
     }
-
-
 }
index adac519ed7851e125ea3e5c34f9eef8b40af0d7d..01e7e18cc25053ee0982e70a25da13285badaab7 100644 (file)
@@ -19,11 +19,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipathBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * Codec for the NX_MULTIPATH
+ * Codec for the NX_MULTIPATH.
  */
 public class MultipathCodec extends AbstractActionCodec {
     public static final int LENGTH = 32;
@@ -35,7 +33,7 @@ public class MultipathCodec extends AbstractActionCodec {
 
     @Override
     public void serialize(final Action input, final ByteBuf outBuffer) {
-        ActionMultipath action = ((ActionMultipath) input.getActionChoice());
+        ActionMultipath action = (ActionMultipath) input.getActionChoice();
         serializeHeader(LENGTH, NXAST_MULTIPATH_SUBTYPE, outBuffer);
 
         outBuffer.writeShort(action.getNxActionMultipath().getFields().getIntValue());
@@ -53,8 +51,8 @@ public class MultipathCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
-        ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
+        final ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
 
         NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
         nxActionMultipathBuilder.setFields(OfjNxHashFields.forValue(message.readUnsignedShort()));
index 2b6f17055765c3229fae6c11dc4593e25353c36c..17833d13128eb57dd773e0011ff2e467caf1da66 100644 (file)
@@ -8,22 +8,19 @@
 package org.opendaylight.openflowjava.nx.codec.action;
 
 /**
- * @author msunal
+ * Defines the Nicira action codecs.
  *
+ * @author msunal
  */
-public class NiciraActionCodecs {
-
-    private NiciraActionCodecs() {
-    }
-
-    public static final RegMoveCodec REG_MOVE_CODEC = new RegMoveCodec();
-    public static final RegLoadCodec REG_LOAD_CODEC = new RegLoadCodec();
-    public static final OutputRegCodec OUTPUT_REG_CODEC = new OutputRegCodec();
-    public static final ResubmitCodec RESUBMIT_CODEC = new ResubmitCodec();
-    public static final MultipathCodec MULTIPATH_CODEC = new MultipathCodec();
-    public static final PushNshCodec PUSH_NSH_CODEC = new PushNshCodec();
-    public static final PopNshCodec POP_NSH_CODEC = new PopNshCodec();
-    public static final ConntrackCodec CONNTRACK_CODEC = new ConntrackCodec();
-    public static final LearnCodec LEARN_CODEC = new LearnCodec();
-    public static final FinTimeoutCodec FIN_TIMEOUT_CODEC = new FinTimeoutCodec();
+public interface NiciraActionCodecs {
+    RegMoveCodec REG_MOVE_CODEC = new RegMoveCodec();
+    RegLoadCodec REG_LOAD_CODEC = new RegLoadCodec();
+    OutputRegCodec OUTPUT_REG_CODEC = new OutputRegCodec();
+    ResubmitCodec RESUBMIT_CODEC = new ResubmitCodec();
+    MultipathCodec MULTIPATH_CODEC = new MultipathCodec();
+    PushNshCodec PUSH_NSH_CODEC = new PushNshCodec();
+    PopNshCodec POP_NSH_CODEC = new PopNshCodec();
+    ConntrackCodec CONNTRACK_CODEC = new ConntrackCodec();
+    LearnCodec LEARN_CODEC = new LearnCodec();
+    FinTimeoutCodec FIN_TIMEOUT_CODEC = new FinTimeoutCodec();
 }
index a959fe0d8f0f01fcf01028d3bb2d3d7034628914..2b27285bae5f0dc4e7858afd6dee11cfd09f1a13 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder;
 
 /**
- * Codec for the Nicira OutputRegAction
+ * Codec for the Nicira OutputRegAction.
  *
  * @author readams
  */
@@ -34,7 +34,7 @@ public class OutputRegCodec extends AbstractActionCodec {
 
     @Override
     public void serialize(final Action input, final ByteBuf outBuffer) {
-        ActionOutputReg action = ((ActionOutputReg) input.getActionChoice());
+        ActionOutputReg action = (ActionOutputReg) input.getActionChoice();
         serializeHeader(LENGTH, SUBTYPE, outBuffer);
         outBuffer.writeShort(action.getNxActionOutputReg().getNBits().shortValue());
         outBuffer.writeInt(action.getNxActionOutputReg().getSrc().intValue());
@@ -44,8 +44,8 @@ public class OutputRegCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
-        ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
+        final ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
         NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
         nxActionOutputRegBuilder.setNBits(message.readUnsignedShort());
         nxActionOutputRegBuilder.setSrc(message.readUnsignedInt());
index f85d093faeff94a94b78657e92f88be7df416b5a..799d3372125e150b4ca6e6812590253175148025 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.pop.nsh.grouping.NxActionPopNshBuilder;
 
 /**
- * Codec for the pop_nsh
+ * Codec for the pop_nsh.
  */
 public class PopNshCodec extends AbstractActionCodec {
     public static final int LENGTH = 16;
@@ -28,13 +28,13 @@ public class PopNshCodec extends AbstractActionCodec {
             new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class);
     public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
             new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_POP_NSH_SUBTYPE);
-    private static final int padding = 6;
+    private static final int PADDING = 6;
 
     @Override
     public void serialize(Action input, ByteBuf outBuffer) {
-        ActionPopNsh action = ((ActionPopNsh) input.getActionChoice());
+        ActionPopNsh action = (ActionPopNsh) input.getActionChoice();
         serializeHeader(LENGTH, NXAST_POP_NSH_SUBTYPE, outBuffer);
-        outBuffer.writeZero(padding);
+        outBuffer.writeZero(PADDING);
     }
 
     @Override
@@ -42,10 +42,9 @@ public class PopNshCodec extends AbstractActionCodec {
         ActionBuilder actionBuilder = deserializeHeader(message);
         ActionPopNshBuilder builder = new ActionPopNshBuilder();
         NxActionPopNshBuilder nxActionPopNshBuilder = new NxActionPopNshBuilder();
-        message.skipBytes(padding);
+        message.skipBytes(PADDING);
         builder.setNxActionPopNsh(nxActionPopNshBuilder.build());
         actionBuilder.setActionChoice(builder.build());
         return actionBuilder.build();
     }
-
 }
index 7a89d1cdaadf5d718fc7638ef8bd4cfd4543d507..69c9fbfd622829394088262d30f7c780dba3319a 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.push.nsh.grouping.NxActionPushNshBuilder;
 
 /**
- * Codec for the push_nsh
+ * Codec for the push_nsh.
  */
 public class PushNshCodec extends AbstractActionCodec {
     public static final int LENGTH = 16;
@@ -28,13 +28,13 @@ public class PushNshCodec extends AbstractActionCodec {
             new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class);
     public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
             new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_PUSH_NSH_SUBTYPE);
-    private static final int padding = 6;
+    private static final int PADDING = 6;
 
     @Override
     public void serialize(Action input, ByteBuf outBuffer) {
-        ActionPushNsh action = ((ActionPushNsh) input.getActionChoice());
+        ActionPushNsh action = (ActionPushNsh) input.getActionChoice();
         serializeHeader(LENGTH, NXAST_PUSH_NSH_SUBTYPE, outBuffer);
-        outBuffer.writeZero(padding);
+        outBuffer.writeZero(PADDING);
     }
 
     @Override
@@ -42,7 +42,7 @@ public class PushNshCodec extends AbstractActionCodec {
         ActionBuilder actionBuilder = deserializeHeader(message);
         ActionPushNshBuilder builder = new ActionPushNshBuilder();
         NxActionPushNshBuilder nxActionPushNshBuilder = new NxActionPushNshBuilder();
-        message.skipBytes(padding);
+        message.skipBytes(PADDING);
         builder.setNxActionPushNsh(nxActionPushNshBuilder.build());
         actionBuilder.setActionChoice(builder.build());
         return actionBuilder.build();
index 873a54535dd282dd97508cefe1c938b015821e2c..fc4d2f25c9108863c1d1c3aa9815bc7f5a7a3c56 100644 (file)
@@ -30,7 +30,7 @@ public class RegLoadCodec extends AbstractActionCodec {
 
     @Override
     public void serialize(final Action input, final ByteBuf outBuffer) {
-        ActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice());
+        ActionRegLoad actionRegLoad = (ActionRegLoad) input.getActionChoice();
         serializeHeader(LENGTH, SUBTYPE, outBuffer);
         outBuffer.writeShort(actionRegLoad.getNxActionRegLoad().getOfsNbits());
         outBuffer.writeInt(actionRegLoad.getNxActionRegLoad().getDst().intValue());
@@ -39,9 +39,9 @@ public class RegLoadCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionBuilder actionBuilder = deserializeHeader(message);
         NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
-        ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
+        final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
         nxActionRegLoadBuilder.setOfsNbits(message.readUnsignedShort());
         nxActionRegLoadBuilder.setDst(message.readUnsignedInt());
         nxActionRegLoadBuilder.setValue(BigInteger.valueOf(message.readLong()));
@@ -49,5 +49,4 @@ public class RegLoadCodec extends AbstractActionCodec {
         actionBuilder.setActionChoice(actionRegLoadBuilder.build());
         return actionBuilder.build();
     }
-
 }
index 8aa1783fc862c457a1995b5b28c63c53660cf1a1..56466ed322520ffe175e4280fb1682c3aa3c12eb 100644 (file)
@@ -29,7 +29,7 @@ public class RegMoveCodec extends AbstractActionCodec {
 
     @Override
     public void serialize(final Action input, final ByteBuf outBuffer) {
-        ActionRegMove actionRegMove = ((ActionRegMove) input.getActionChoice());
+        ActionRegMove actionRegMove = (ActionRegMove) input.getActionChoice();
         serializeHeader(LENGTH, SUBTYPE, outBuffer);
         outBuffer.writeShort(actionRegMove.getNxActionRegMove().getNBits());
         outBuffer.writeShort(actionRegMove.getNxActionRegMove().getSrcOfs());
@@ -40,8 +40,8 @@ public class RegMoveCodec extends AbstractActionCodec {
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
-        ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
+        final ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
         NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
         nxActionRegMoveBuilder.setNBits(message.readUnsignedShort());
         nxActionRegMoveBuilder.setSrcOfs(message.readUnsignedShort());
@@ -52,5 +52,4 @@ public class RegMoveCodec extends AbstractActionCodec {
         actionBuilder.setActionChoice(actionRegMoveBuilder.build());
         return actionBuilder.build();
     }
-
 }
index f3ac951cc56086cf8a5f48f6031b0e225b739075..ade0947bc74a7238cc781f44112754d220dfa805 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmitBuilder;
 
 /**
- * Codec for the NX_RESUBMIT and NX_RESUBMIT_TABLE
+ * Codec for the NX_RESUBMIT and NX_RESUBMIT_TABLE.
  */
 public class ResubmitCodec extends AbstractActionCodec {
 
@@ -35,10 +35,11 @@ public class ResubmitCodec extends AbstractActionCodec {
 
     private static final byte OFP_TABLE_ALL = (byte) 255;
     private static final short OFP_IN_PORT = (short) 0xfff8;
-    private static final int padding = 3; // nx_action_resubmit : uint8_t pad[3];
+    private static final int PADDING = 3; // nx_action_resubmit : uint8_t pad[3];
 
     public byte getSubType(final ActionResubmit action) {
-        if ((action.getNxActionResubmit().getTable() == null) || (action.getNxActionResubmit().getTable().byteValue() == OFP_TABLE_ALL)) {
+        if (action.getNxActionResubmit().getTable() == null
+                || action.getNxActionResubmit().getTable().byteValue() == OFP_TABLE_ALL) {
             return NXAST_RESUBMIT_SUBTYPE;
         }
         return NXAST_RESUBMIT_TABLE_SUBTYPE;
@@ -49,7 +50,7 @@ public class ResubmitCodec extends AbstractActionCodec {
         byte table = OFP_TABLE_ALL;
         short inPort = OFP_IN_PORT;
 
-        ActionResubmit action = ((ActionResubmit) input.getActionChoice());
+        ActionResubmit action = (ActionResubmit) input.getActionChoice();
         serializeHeader(LENGTH, getSubType(action), outBuffer);
 
         if (action.getNxActionResubmit().getInPort() != null) {
@@ -60,19 +61,19 @@ public class ResubmitCodec extends AbstractActionCodec {
         }
         outBuffer.writeShort(inPort);
         outBuffer.writeByte(table);
-        outBuffer.writeZero(padding);
+        outBuffer.writeZero(PADDING);
     }
 
     @Override
     public Action deserialize(final ByteBuf message) {
-        ActionBuilder actionBuilder = deserializeHeader(message);
+        final ActionBuilder actionBuilder = deserializeHeader(message);
 
         ActionResubmitBuilder builder = new ActionResubmitBuilder();
         NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
         nxActionResubmitBuilder.setInPort(message.readUnsignedShort());
         nxActionResubmitBuilder.setTable(message.readUnsignedByte());
         builder.setNxActionResubmit(nxActionResubmitBuilder.build());
-        message.skipBytes(padding);
+        message.skipBytes(PADDING);
 
         actionBuilder.setActionChoice(builder.build());
         return actionBuilder.build();
index 3e2d7116d072d014013d77bbad0af84bbac632d5..fe28a3c0e85f4aac56df5df1765988efdada0065 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
@@ -74,27 +73,27 @@ public abstract class AbstractMatchCodec implements
     }
 
     /**
-     * @return numeric representation of nxm_field
+     * Returns the numeric representation of nxm_field.
      */
     public abstract int getNxmFieldCode();
 
     /**
-     * @return numeric representation of oxm_class
+     * Returns the numeric representation of oxm_class.
      */
     public abstract int getOxmClassCode();
 
     /**
-     * @return match entry value length
+     * Returns the match entry value length.
      */
     public abstract int getValueLength();
 
     /**
-     * @return nxm_field class
+     * Returns the nxm_field class.
      */
     public abstract Class<? extends MatchField> getNxmField();
 
     /**
-     * @return oxm_class class
+     * Returns the oxm_class class.
      */
     public abstract Class<? extends OxmClassBase> getOxmClass();
 
index 0e1ebe407e98549b41a06b6f06a330bf528712de..cf1e896c46bcdba1ccbffde69eac1a8ed35d56aa 100755 (executable)
@@ -9,25 +9,25 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.mark.grouping.CtMarkValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValueBuilder;
 
 /**
+ * Codec for CtMark.
+ * s
  * @author Bertrand Low.
  */
-
 public class CtMarkCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 8;
@@ -47,7 +47,7 @@ public class CtMarkCodec extends AbstractMatchCodec {
 
     @Override
     public MatchEntry deserialize(ByteBuf message) {
-        MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+        final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
         CtMarkCaseValueBuilder caseBuilder = new CtMarkCaseValueBuilder();
         CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
         if (matchEntryBuilder.isHasMask()) {
index ef677c09d4650ce3592fc3afdeec6ef65a64c20a..978a660c2ec4c855f2af2076b65647b6d2ed3655 100644 (file)
@@ -9,25 +9,25 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtState;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.state.grouping.CtStateValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValueBuilder;
 
 /**
+ * Codec for CtSate.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class CtStateCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 8;
@@ -40,14 +40,14 @@ public class CtStateCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        CtStateCaseValue ctStateCase = ((CtStateCaseValue) input.getMatchEntryValue());
+        CtStateCaseValue ctStateCase = (CtStateCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ctStateCase.getCtStateValues().getCtState().intValue());
         outBuffer.writeInt(ctStateCase.getCtStateValues().getMask().intValue());
     }
 
     @Override
     public MatchEntry deserialize(ByteBuf message) {
-        MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+        final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
         CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
         CtStateValuesBuilder ctStateValuesBuilder = new CtStateValuesBuilder();
         ctStateValuesBuilder.setCtState(message.readUnsignedInt());
index e6d4b7b0e3746f95bb736e7a1b63f9f01534d23c..4ed771218ec62d5ebda095439ea3474d80b61c61 100644 (file)
@@ -9,25 +9,25 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValueBuilder;
 
 /**
+ * Codec for CtZone.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class CtZoneCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 2;
@@ -40,7 +40,7 @@ public class CtZoneCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        CtZoneCaseValue ctZoneCase = ((CtZoneCaseValue) input.getMatchEntryValue());
+        CtZoneCaseValue ctZoneCase = (CtZoneCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(ctZoneCase.getCtZoneValues().getCtZone());
     }
 
index e9e827fa27e67d9fe7d44da5042207e60b3c777e..d27b7d06753186d5bc15e0b34d9ef2fe32209d8c 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -30,15 +29,15 @@ public class EncapEthDstCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 122;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthDst> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthDst.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthDst> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthDst.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        EncapEthDstCaseValue value = ((EncapEthDstCaseValue) input.getMatchEntryValue());
+        EncapEthDstCaseValue value = (EncapEthDstCaseValue) input.getMatchEntryValue();
         outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthDstValues().getMacAddress().getValue()));
     }
 
index 0530182d4939cc88039cd1d13ef6a0e716bf7780..868835e050014f5b9ef3beabdc7bfc89f108f36d 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -30,15 +29,15 @@ public class EncapEthSrcCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 121;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthSrc> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthSrc.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthSrc> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthSrc.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        EncapEthSrcCaseValue value = ((EncapEthSrcCaseValue) input.getMatchEntryValue());
+        EncapEthSrcCaseValue value = (EncapEthSrcCaseValue) input.getMatchEntryValue();
         outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthSrcValues().getMacAddress().getValue()));
     }
 
index e34f1968c14ed119493142846552c04de9c39138..d733f486c2c3c397fa93a969c11a6b3152f8f0a5 100644 (file)
@@ -27,23 +27,24 @@ public class EncapEthTypeCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 2;
     private static final int NXM_FIELD_CODE = 123;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthType> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthType.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthType> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthType.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        EncapEthTypeCaseValue encapEthTypeCaseValue = ((EncapEthTypeCaseValue) input.getMatchEntryValue());
+        EncapEthTypeCaseValue encapEthTypeCaseValue = (EncapEthTypeCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(encapEthTypeCaseValue.getEncapEthTypeValues().getEncapEthType().intValue());
     }
 
     @Override
     public MatchEntry deserialize(ByteBuf message) {
         MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
-        EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder= new EncapEthTypeCaseValueBuilder();
-        encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder().setEncapEthType(message.readUnsignedShort()).build());
+        EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
+        encapEthTypeCaseValueBuilder.setEncapEthTypeValues(
+                new EncapEthTypeValuesBuilder().setEncapEthType(message.readUnsignedShort()).build());
         matchEntryBuilder.setMatchEntryValue(encapEthTypeCaseValueBuilder.build());
         matchEntryBuilder.setHasMask(false);
         return matchEntryBuilder.build();
index 7cec31ff108fa3f9031f9ee00f630a4fcaa2b210..19a2ab9939780c85a54b8fb5a17827fee3ff4f55 100644 (file)
@@ -12,24 +12,26 @@ import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIcmpType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValue;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIcmpType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.icmp.type.grouping.IcmpTypeValuesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValueBuilder;
 
 /**
+ * Codec for the Icmp type message.
+ *
  * @author Josh Hershberg (jhershbe@redhat.com)
  */
 public class IcmpTypeCodec extends AbstractMatchCodec {
     private static final int VALUE_LENGTH = 1;
     private static final int NXM_FIELD_CODE = 13;
-    public static final MatchEntrySerializerKey<Nxm0Class, NxmOfIcmpType> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfIcmpType.class);
+    public static final MatchEntrySerializerKey<Nxm0Class, NxmOfIcmpType> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfIcmpType.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, NXM_FIELD_CODE);
 
@@ -37,7 +39,8 @@ public class IcmpTypeCodec extends AbstractMatchCodec {
     public MatchEntry deserialize(ByteBuf message) {
         MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
         IcmpTypeCaseValueBuilder icmpTypeCaseValueBuilder = new IcmpTypeCaseValueBuilder();
-        icmpTypeCaseValueBuilder.setIcmpTypeValues(new IcmpTypeValuesBuilder().setValue(message.readUnsignedByte()).build());
+        icmpTypeCaseValueBuilder.setIcmpTypeValues(new IcmpTypeValuesBuilder()
+                .setValue(message.readUnsignedByte()).build());
         matchEntriesBuilder.setMatchEntryValue(icmpTypeCaseValueBuilder.build());
         matchEntriesBuilder.setHasMask(false);
         return matchEntriesBuilder.build();
@@ -46,7 +49,7 @@ public class IcmpTypeCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        IcmpTypeCaseValue icmpTypeValue = ((IcmpTypeCaseValue) input.getMatchEntryValue());
+        IcmpTypeCaseValue icmpTypeValue = (IcmpTypeCaseValue) input.getMatchEntryValue();
         outBuffer.writeByte(icmpTypeValue.getIcmpTypeValues().getValue());
     }
 
index f34f89cb799258ec13396172dc0ccddbb251f8cd..1ff96ffd2d18cbdc1069b6392e7937a2ae0e103d 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowjava.nx.codec.match;
 
+import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -21,8 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder;
 
-import io.netty.buffer.ByteBuf;
-
 public class InPortCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 2;
@@ -78,5 +77,4 @@ public class InPortCodec extends AbstractMatchCodec {
     public Class<? extends OxmClassBase> getOxmClass() {
         return Nxm0Class.class;
     }
-
 }
index 4e6014ab5f3e6e3681ff672be04d68b8bb7e7036..4f60c526d7f97a64a31ef0032c0e0404a9b8c114 100644 (file)
@@ -8,22 +8,23 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpDst;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.dst.grouping.IpDstValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.dst.grouping.IpDstValuesBuilder;
 
 /**
+ * Codec for the IpDst message.
+ *
  * @author Josh Hershberg (jhershbe@redhat.com)
  */
 public class IpDstCodec extends AbstractMatchCodec {
@@ -48,7 +49,7 @@ public class IpDstCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        IpDstCaseValue ipDstCase = ((IpDstCaseValue) input.getMatchEntryValue());
+        IpDstCaseValue ipDstCase = (IpDstCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ipDstCase.getIpDstValues().getValue().intValue());
     }
 
@@ -76,5 +77,4 @@ public class IpDstCodec extends AbstractMatchCodec {
     public Class<? extends OxmClassBase> getOxmClass() {
         return Nxm0Class.class;
     }
-
 }
index 6aa54e8155941d2ec8a77564259b98e79180a2c6..6e5cf893ff266d919ddc6b00f1c21f98b92c372d 100644 (file)
@@ -8,22 +8,23 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpSrc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.src.grouping.IpSrcValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.src.grouping.IpSrcValuesBuilder;
 
 /**
+ * Codec for the IpSrc message.
+ *
  * @author Josh Hershberg (jhershbe@redhat.com)
  */
 public class IpSrcCodec extends AbstractMatchCodec {
@@ -48,7 +49,7 @@ public class IpSrcCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        IpSrcCaseValue ipSrcCase = ((IpSrcCaseValue) input.getMatchEntryValue());
+        IpSrcCaseValue ipSrcCase = (IpSrcCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ipSrcCase.getIpSrcValues().getValue().intValue());
     }
 
index 2fc93c44301d30cfcd9fe841fa13ebc474d15294..40957be303b579ef951e8228597fe9e9f8f489f7 100644 (file)
@@ -23,6 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValueBuilder;
 
 /**
+ * Codec for the Ipv6Dst message.
+ *
  * @author Sridhar Gaddam (sgaddam@redhat.com)
  */
 public class Ipv6DstCodec extends AbstractMatchCodec {
@@ -47,7 +49,7 @@ public class Ipv6DstCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        IpDstCaseValue ipDstCase = ((IpDstCaseValue) input.getMatchEntryValue());
+        IpDstCaseValue ipDstCase = (IpDstCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ipDstCase.getIpDstValues().getValue().intValue());
     }
 
index 7d36f007871c1ed1fe32705fd67bec8ce197279e..761065cf0e6e08121e725556b9576e2eaba28ff0 100644 (file)
@@ -23,6 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValueBuilder;
 
 /**
+ * Codec for the Ipv6Src message.
+ *
  * @author Sridhar Gaddam (sgaddam@redhat.com)
  */
 public class Ipv6SrcCodec extends AbstractMatchCodec {
@@ -47,7 +49,7 @@ public class Ipv6SrcCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        IpSrcCaseValue ipSrcCase = ((IpSrcCaseValue) input.getMatchEntryValue());
+        IpSrcCaseValue ipSrcCase = (IpSrcCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ipSrcCase.getIpSrcValues().getValue().intValue());
     }
 
index bf32c36cd4b49030547ca1ada912b2502360f9f5..cdfe0038be73f77e7585fa237770a37460252f73 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowjava.nx.codec.match;
 
+import io.netty.buffer.ByteBuf;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -21,61 +22,57 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfMplsLabelCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfMplsLabelCaseValueBuilder;
 
-import io.netty.buffer.ByteBuf;
-
 public class MplsLabelCodec extends AbstractMatchCodec {
 
-  private static final int VALUE_LENGTH = 4;
-  private static final int NXM_FIELD_CODE = 34;
+    private static final int VALUE_LENGTH = 4;
+    private static final int NXM_FIELD_CODE = 34;
 
-  public static final MatchEntrySerializerKey<Nxm0Class, NxmOfMplsLabel> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-      EncodeConstants.OF13_VERSION_ID, Nxm0Class.class,
-      NxmOfMplsLabel.class);
+    public static final MatchEntrySerializerKey<Nxm0Class, NxmOfMplsLabel> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfMplsLabel.class);
 
-  public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
-      EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS,
-      NXM_FIELD_CODE);
+    public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
+            EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, NXM_FIELD_CODE);
 
-  @Override
-  public void serialize(MatchEntry input, ByteBuf outBuffer) {
-    serializeHeader(input, outBuffer);
-    OfMplsLabelCaseValue value = (OfMplsLabelCaseValue) input.getMatchEntryValue();
-    outBuffer.writeInt(value.getMplsLabelValues().getMplsLabel().intValue());
-  }
+    @Override
+    public void serialize(MatchEntry input, ByteBuf outBuffer) {
+        serializeHeader(input, outBuffer);
+        OfMplsLabelCaseValue value = (OfMplsLabelCaseValue) input.getMatchEntryValue();
+        outBuffer.writeInt(value.getMplsLabelValues().getMplsLabel().intValue());
+    }
 
-  @Override
-  public MatchEntry deserialize(ByteBuf message) {
-    MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
-    OfMplsLabelCaseValueBuilder caseBuilder = new OfMplsLabelCaseValueBuilder();
-    MplsLabelValuesBuilder valuesBuilder = new MplsLabelValuesBuilder();
-    valuesBuilder.setMplsLabel(message.readLong()).build();
-    caseBuilder.setMplsLabelValues(valuesBuilder.build());
-    matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
-    return matchEntryBuilder.build();
-  }
+    @Override
+    public MatchEntry deserialize(ByteBuf message) {
+        MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+        OfMplsLabelCaseValueBuilder caseBuilder = new OfMplsLabelCaseValueBuilder();
+        MplsLabelValuesBuilder valuesBuilder = new MplsLabelValuesBuilder();
+        valuesBuilder.setMplsLabel(message.readLong()).build();
+        caseBuilder.setMplsLabelValues(valuesBuilder.build());
+        matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
+        return matchEntryBuilder.build();
+    }
 
-  @Override
-  public int getNxmFieldCode() {
-    return NXM_FIELD_CODE;
-  }
+    @Override
+    public int getNxmFieldCode() {
+        return NXM_FIELD_CODE;
+    }
 
-  @Override
-  public int getOxmClassCode() {
-    return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
-  }
+    @Override
+    public int getOxmClassCode() {
+        return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+    }
 
-  @Override
-  public int getValueLength() {
-    return VALUE_LENGTH;
-  }
+    @Override
+    public int getValueLength() {
+        return VALUE_LENGTH;
+    }
 
-  @Override
-  public Class<? extends MatchField> getNxmField() {
-    return NxmOfMplsLabel.class;
-  }
+    @Override
+    public Class<? extends MatchField> getNxmField() {
+        return NxmOfMplsLabel.class;
+    }
 
-  @Override
-  public Class<? extends OxmClassBase> getOxmClass() {
-    return Nxm0Class.class;
-  }
+    @Override
+    public Class<? extends OxmClassBase> getOxmClass() {
+        return Nxm0Class.class;
+    }
 }
index 8ae07b8724ec3aac417c443b0480eceac192654f..82958403f964ca76ef6d53d5103b42d16b17a5e7 100644 (file)
@@ -8,56 +8,56 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 /**
+ * Defines Nicira match codecs.
+ *
  * @author msunal
  * @author Josh Hershberg (jhershbe@redhat.com)
  */
-public class NiciraMatchCodecs {
-    private NiciraMatchCodecs () { }
-
-    public static final Reg0Codec REG0_CODEC = new Reg0Codec();
-    public static final Reg1Codec REG1_CODEC = new Reg1Codec();
-    public static final Reg2Codec REG2_CODEC = new Reg2Codec();
-    public static final Reg3Codec REG3_CODEC = new Reg3Codec();
-    public static final Reg4Codec REG4_CODEC = new Reg4Codec();
-    public static final Reg5Codec REG5_CODEC = new Reg5Codec();
-    public static final Reg6Codec REG6_CODEC = new Reg6Codec();
-    public static final Reg7Codec REG7_CODEC = new Reg7Codec();
-    public static final TunIdCodec TUN_ID_CODEC = new TunIdCodec();
-    public static final ArpOpCodec ARP_OP_CODEC = new ArpOpCodec();
-    public static final ArpShaCodec ARP_SHA_CODEC = new ArpShaCodec();
-    public static final ArpSpaCodec ARP_SPA_CODEC = new ArpSpaCodec();
-    public static final ArpThaCodec ARP_THA_CODEC = new ArpThaCodec();
-    public static final ArpTpaCodec ARP_TPA_CODEC = new ArpTpaCodec();
-    public static final InPortCodec NXM_OF_IN_PORT_CODEC = new InPortCodec();
-    public static final MplsLabelCodec OXM_OF_MPLS_LABEL = new MplsLabelCodec();
-    public static final MetadataCodec OXM_OF_METADATA_CODEC = new MetadataCodec();
-    public static final EthDstCodec ETH_DST_CODEC = new EthDstCodec();
-    public static final EthSrcCodec ETH_SRC_CODEC = new EthSrcCodec();
-    public static final TunIpv4DstCodec TUN_IPV4_DST_CODEC = new TunIpv4DstCodec();
-    public static final TunIpv4SrcCodec TUN_IPV4_SRC_CODEC = new TunIpv4SrcCodec();
-    public static final EthTypeCodec ETH_TYPE_CODEC = new EthTypeCodec();
-    public static final NspCodec NSP_CODEC = new NspCodec();
-    public static final NsiCodec NSI_CODEC = new NsiCodec();
-    public static final Nshc1Codec NSC1_CODEC = new Nshc1Codec();
-    public static final Nshc2Codec NSC2_CODEC = new Nshc2Codec();
-    public static final Nshc3Codec NSC3_CODEC = new Nshc3Codec();
-    public static final Nshc4Codec NSC4_CODEC = new Nshc4Codec();
-    public static final EncapEthTypeCodec ENCAP_ETH_TYPE_CODEC = new EncapEthTypeCodec();
-    public static final EncapEthSrcCodec ENCAP_ETH_SRC_CODEC = new EncapEthSrcCodec();
-    public static final EncapEthDstCodec ENCAP_ETH_DST_CODEC = new EncapEthDstCodec();
-    public static final NshMdtypeCodec NSH_MDTYPE_CODEC = new NshMdtypeCodec();
-    public static final NshNpCodec NSH_NP_CODEC = new NshNpCodec();
-    public static final TunGpeNpCodec TUN_GPE_NP_CODEC = new TunGpeNpCodec();
-    public static final TcpSrcCodec TCP_SRC_CODEC = new TcpSrcCodec();
-    public static final TcpDstCodec TCP_DST_CODEC = new TcpDstCodec();
-    public static final UdpSrcCodec UDP_SRC_CODEC = new UdpSrcCodec();
-    public static final UdpDstCodec UDP_DST_CODEC = new UdpDstCodec();
-    public static final CtStateCodec CT_ST_CODEC = new CtStateCodec();
-    public static final CtZoneCodec CT_ZONE_CODEC = new CtZoneCodec();
-    public static final IpSrcCodec IP_SRC_CODEC = new IpSrcCodec();
-    public static final IpDstCodec IP_DST_CODEC = new IpDstCodec();
-    public static final Ipv6SrcCodec IPV6_SRC_CODEC = new Ipv6SrcCodec();
-    public static final Ipv6DstCodec IPV6_DST_CODEC = new Ipv6DstCodec();
-    public static final IcmpTypeCodec ICMP_TYPE_CODEC = new IcmpTypeCodec();
-    public static final CtMarkCodec CT_MARK_CODEC = new CtMarkCodec();
+public interface NiciraMatchCodecs {
+    Reg0Codec REG0_CODEC = new Reg0Codec();
+    Reg1Codec REG1_CODEC = new Reg1Codec();
+    Reg2Codec REG2_CODEC = new Reg2Codec();
+    Reg3Codec REG3_CODEC = new Reg3Codec();
+    Reg4Codec REG4_CODEC = new Reg4Codec();
+    Reg5Codec REG5_CODEC = new Reg5Codec();
+    Reg6Codec REG6_CODEC = new Reg6Codec();
+    Reg7Codec REG7_CODEC = new Reg7Codec();
+    TunIdCodec TUN_ID_CODEC = new TunIdCodec();
+    ArpOpCodec ARP_OP_CODEC = new ArpOpCodec();
+    ArpShaCodec ARP_SHA_CODEC = new ArpShaCodec();
+    ArpSpaCodec ARP_SPA_CODEC = new ArpSpaCodec();
+    ArpThaCodec ARP_THA_CODEC = new ArpThaCodec();
+    ArpTpaCodec ARP_TPA_CODEC = new ArpTpaCodec();
+    InPortCodec NXM_OF_IN_PORT_CODEC = new InPortCodec();
+    MplsLabelCodec OXM_OF_MPLS_LABEL = new MplsLabelCodec();
+    MetadataCodec OXM_OF_METADATA_CODEC = new MetadataCodec();
+    EthDstCodec ETH_DST_CODEC = new EthDstCodec();
+    EthSrcCodec ETH_SRC_CODEC = new EthSrcCodec();
+    TunIpv4DstCodec TUN_IPV4_DST_CODEC = new TunIpv4DstCodec();
+    TunIpv4SrcCodec TUN_IPV4_SRC_CODEC = new TunIpv4SrcCodec();
+    EthTypeCodec ETH_TYPE_CODEC = new EthTypeCodec();
+    NspCodec NSP_CODEC = new NspCodec();
+    NsiCodec NSI_CODEC = new NsiCodec();
+    Nshc1Codec NSC1_CODEC = new Nshc1Codec();
+    Nshc2Codec NSC2_CODEC = new Nshc2Codec();
+    Nshc3Codec NSC3_CODEC = new Nshc3Codec();
+    Nshc4Codec NSC4_CODEC = new Nshc4Codec();
+    EncapEthTypeCodec ENCAP_ETH_TYPE_CODEC = new EncapEthTypeCodec();
+    EncapEthSrcCodec ENCAP_ETH_SRC_CODEC = new EncapEthSrcCodec();
+    EncapEthDstCodec ENCAP_ETH_DST_CODEC = new EncapEthDstCodec();
+    NshMdtypeCodec NSH_MDTYPE_CODEC = new NshMdtypeCodec();
+    NshNpCodec NSH_NP_CODEC = new NshNpCodec();
+    TunGpeNpCodec TUN_GPE_NP_CODEC = new TunGpeNpCodec();
+    TcpSrcCodec TCP_SRC_CODEC = new TcpSrcCodec();
+    TcpDstCodec TCP_DST_CODEC = new TcpDstCodec();
+    UdpSrcCodec UDP_SRC_CODEC = new UdpSrcCodec();
+    UdpDstCodec UDP_DST_CODEC = new UdpDstCodec();
+    CtStateCodec CT_ST_CODEC = new CtStateCodec();
+    CtZoneCodec CT_ZONE_CODEC = new CtZoneCodec();
+    IpSrcCodec IP_SRC_CODEC = new IpSrcCodec();
+    IpDstCodec IP_DST_CODEC = new IpDstCodec();
+    Ipv6SrcCodec IPV6_SRC_CODEC = new Ipv6SrcCodec();
+    Ipv6DstCodec IPV6_DST_CODEC = new Ipv6DstCodec();
+    IcmpTypeCodec ICMP_TYPE_CODEC = new IcmpTypeCodec();
+    CtMarkCodec CT_MARK_CODEC = new CtMarkCodec();
 }
index bab8a06b176726eab1ead91ca960653b88e74663..ed1c74e38362817e29a824c46bd01d2cd4c36c54 100644 (file)
@@ -27,15 +27,15 @@ public class NshMdtypeCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 1;
     private static final int NXM_FIELD_CODE = 119;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNshMdtype> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshMdtype.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNshMdtype> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshMdtype.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        NshMdtypeCaseValue nshMdtypeCaseValue = ((NshMdtypeCaseValue) input.getMatchEntryValue());
+        NshMdtypeCaseValue nshMdtypeCaseValue = (NshMdtypeCaseValue) input.getMatchEntryValue();
         outBuffer.writeByte(nshMdtypeCaseValue.getNshMdtypeValues().getValue());
     }
 
@@ -43,7 +43,8 @@ public class NshMdtypeCodec extends AbstractMatchCodec {
     public MatchEntry deserialize(ByteBuf message) {
         MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
         NshMdtypeCaseValueBuilder nshMdtypeCaseValueBuilder = new NshMdtypeCaseValueBuilder();
-        nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder().setValue(message.readUnsignedByte()).build());
+        nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder()
+                .setValue(message.readUnsignedByte()).build());
         matchEntriesBuilder.setMatchEntryValue(nshMdtypeCaseValueBuilder.build());
         matchEntriesBuilder.setHasMask(false);
         return matchEntriesBuilder.build();
index 394ef58ff787a2d9b305f6786c56a44c91f792bb..eca51946fe5861e6fbfc684d33bafe88a1e77f6b 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -10,8 +10,9 @@ package org.opendaylight.openflowjava.nx.codec.match;
 import com.google.common.primitives.Ints;
 
 /**
- * @author msunal
+ * Nxm header.
  *
+ * @author msunal
  */
 public class NxmHeader {
 
@@ -34,11 +35,11 @@ public class NxmHeader {
         this.nxmField = nxmField;
         this.hasMask = hasMask;
         this.length = length;
-        this.headerAsLong = ((((long) oxmClass) << 16) | (nxmField << 9) | ((hasMask ? 1 : 0) << 8) | (length));
+        this.headerAsLong = (long) oxmClass << 16 | nxmField << 9 | (hasMask ? 1 : 0) << 8 | length;
     }
 
-    private static long extractSub(final long l, final int nrBits, final int offset) {
-        final long rightShifted = l >>> offset;
+    private static long extractSub(final long value, final int nrBits, final int offset) {
+        final long rightShifted = value >>> offset;
         final long mask = (1L << nrBits) - 1L;
         return rightShifted & mask;
     }
@@ -67,7 +68,7 @@ public class NxmHeader {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + (int) (headerAsLong ^ (headerAsLong >>> 32));
+        result = prime * result + (int) (headerAsLong ^ headerAsLong >>> 32);
         return result;
     }
 
index 5052d5662c7af496757101667465092cddebf898..e3ace5dd7c1108131ac9211c415288a8e76214b6 100644 (file)
@@ -9,27 +9,26 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpDst;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.tcp.dst.grouping.TcpDstValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpDstCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpDstCaseValueBuilder;
 
 /**
+ * Codec for the TcpDst message.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class TcpDstCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
@@ -42,7 +41,7 @@ public class TcpDstCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        TcpDstCaseValue tcpDstCase = ((TcpDstCaseValue) input.getMatchEntryValue());
+        TcpDstCaseValue tcpDstCase = (TcpDstCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(tcpDstCase.getTcpDstValues().getPort().getValue());
         outBuffer.writeShort(tcpDstCase.getTcpDstValues().getMask());
     }
index c003d62eeaf94b6fbca088e15125ba4bfccd0aa1..182d222914d0a075a4df5af523e354bbea61a6b7 100644 (file)
@@ -9,26 +9,26 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpSrc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.tcp.src.grouping.TcpSrcValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpSrcCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpSrcCaseValueBuilder;
 
 /**
+ * Codec for the TcpSrc message..
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class TcpSrcCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
@@ -41,7 +41,7 @@ public class TcpSrcCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        TcpSrcCaseValue tcpSrcCase = ((TcpSrcCaseValue) input.getMatchEntryValue());
+        TcpSrcCaseValue tcpSrcCase = (TcpSrcCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getPort().getValue());
         outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getMask());
     }
index b00a58e98e7668bdd2edfc75448ab94695a06286..61ed19ebacec0c53d02fdc5dfa95b08bbf679d95 100644 (file)
@@ -27,15 +27,15 @@ public class TunGpeNpCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 1;
     private static final int NXM_FIELD_CODE = 111;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunGpeNp> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunGpeNp.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunGpeNp> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunGpeNp.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        TunGpeNpCaseValue tunGpeNpCaseValue = ((TunGpeNpCaseValue) input.getMatchEntryValue());
+        TunGpeNpCaseValue tunGpeNpCaseValue = (TunGpeNpCaseValue) input.getMatchEntryValue();
         outBuffer.writeByte(tunGpeNpCaseValue.getTunGpeNpValues().getValue());
     }
 
@@ -43,7 +43,8 @@ public class TunGpeNpCodec extends AbstractMatchCodec {
     public MatchEntry deserialize(ByteBuf message) {
         MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
         TunGpeNpCaseValueBuilder tunGpeNpCaseValueBuilder = new TunGpeNpCaseValueBuilder();
-        tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder().setValue(message.readUnsignedByte()).build());
+        tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder()
+                .setValue(message.readUnsignedByte()).build());
         matchEntriesBuilder.setMatchEntryValue(tunGpeNpCaseValueBuilder.build());
         matchEntriesBuilder.setHasMask(false);
         return matchEntriesBuilder.build();
index 8c795ae48462a58f7b3f35690c45c8cdec705201..d1b4a3d4e70fd446cb22ffb95d0b41e39ec11907 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -28,8 +27,8 @@ public class TunIpv4DstCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 32;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Dst> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Dst> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
index d0c776e0aac564a5e783e641f40ee38fc6658fd2..166f675f4418bc6a2011512d504aadb2355deccb 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -28,8 +27,8 @@ public class TunIpv4SrcCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 31;
-    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Src> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
-            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class);
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Src> SERIALIZER_KEY =
+            new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class);
     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
             EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
 
index 78d006a46c80432a2af3bb7bc39d5e84ac87143f..37c90b75ddff905ed37bdc7aa9d8fb55f5d3c291 100644 (file)
@@ -9,28 +9,26 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpDst;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.dst.grouping.UdpDstValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValueBuilder;
 
 /**
+ * Codec for the UdpDst message.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class UdpDstCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
@@ -43,7 +41,7 @@ public class UdpDstCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        UdpDstCaseValue udpDstCase = ((UdpDstCaseValue) input.getMatchEntryValue());
+        UdpDstCaseValue udpDstCase = (UdpDstCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(udpDstCase.getUdpDstValues().getPort().getValue());
         outBuffer.writeShort(udpDstCase.getUdpDstValues().getMask());
     }
index 42e402ae392103f988c3706c684158c3ff7c6bc2..2567f43144e89741437f994737657af5d9cbedd0 100644 (file)
@@ -9,28 +9,26 @@
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpSrc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.src.grouping.UdpSrcValuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpSrcCaseValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpSrcCaseValueBuilder;
 
 /**
+ * Codec for the UdpSrc message.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class UdpSrcCodec extends AbstractMatchCodec {
 
     private static final int VALUE_LENGTH = 4;
@@ -43,7 +41,7 @@ public class UdpSrcCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        UdpSrcCaseValue udpSrcCase = ((UdpSrcCaseValue) input.getMatchEntryValue());
+        UdpSrcCaseValue udpSrcCase = (UdpSrcCaseValue) input.getMatchEntryValue();
         outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getPort().getValue());
         outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getMask());
     }
index f44004163547de9b62733d5ad51828f8c7bedaa9..1da31678de010ac0f87680da35ef470eb9d07d7a 100644 (file)
@@ -83,8 +83,10 @@ public class NiciraExtensionCodecRegistratorImplTest {
 
     @Test
     public void niciraExtensionsCodecRegistratorImplTest() {
-        Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF10_DESERIALIZER_KEY), Matchers.any(ActionDeserializer.class));
-        Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF13_DESERIALIZER_KEY), Matchers.any(ActionDeserializer.class));
+        Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF10_DESERIALIZER_KEY),
+                Matchers.any(ActionDeserializer.class));
+        Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF13_DESERIALIZER_KEY),
+                Matchers.any(ActionDeserializer.class));
     }
 
     @Test
@@ -140,6 +142,4 @@ public class NiciraExtensionCodecRegistratorImplTest {
         niciraExtensionCodecRegistrator.unregisterMatchEntryDeserializer(matchDeserializerKey);
         Mockito.verify(provider).unregisterDeserializer(matchDeserializerKey);
     }
-
-
-}
\ No newline at end of file
+}
index 50c97898034c65fe9a283007fe916b5696b45c82..daf275077268cf77fcb349f2956574701d8bc0c6 100644 (file)
@@ -19,11 +19,11 @@ import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
 import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
 import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
 import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
@@ -65,11 +65,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionConntrack;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpSha;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpTha;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark;
@@ -118,170 +118,408 @@ public class NiciraExtensionsRegistratorTest {
 
     @Test
     public void registerNiciraExtensionsTest() {
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)), Matchers.any(RegLoadCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)), Matchers.any(RegLoadCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)), Matchers.any(RegMoveCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)), Matchers.any(RegMoveCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)), Matchers.any(OutputRegCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)), Matchers.any(OutputRegCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)), Matchers.any(ResubmitCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)), Matchers.any(ResubmitCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)), Matchers.any(ResubmitCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)), Matchers.any(MultipathCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)), Matchers.any(MultipathCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38)), Matchers.any(PushNshCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class)), Matchers.any(PushNshCodec.class));
-        Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39)), Matchers.any(PopNshCodec.class));
-        Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class)), Matchers.any(PopNshCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)), Matchers.any(Reg0Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)), Matchers.any(Reg0Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)), Matchers.any(Reg1Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)), Matchers.any(Reg1Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)), Matchers.any(Reg2Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)), Matchers.any(Reg2Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)), Matchers.any(Reg3Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)), Matchers.any(Reg3Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)), Matchers.any(Reg4Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)), Matchers.any(Reg4Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)), Matchers.any(Reg5Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)), Matchers.any(Reg5Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)), Matchers.any(Reg6Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)), Matchers.any(Reg6Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)), Matchers.any(Reg7Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)), Matchers.any(Reg7Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)), Matchers.any(TunIdCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)), Matchers.any(TunIdCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)), Matchers.any(ArpOpCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)), Matchers.any(ArpOpCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)), Matchers.any(ArpShaCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)), Matchers.any(ArpShaCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)), Matchers.any(ArpSpaCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)), Matchers.any(ArpSpaCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)), Matchers.any(ArpThaCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)), Matchers.any(ArpThaCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)), Matchers.any(ArpTpaCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)), Matchers.any(ArpTpaCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)), Matchers.any(EthDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)), Matchers.any(EthDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)), Matchers.any(EthSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)), Matchers.any(EthSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)), Matchers.any(EthTypeCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)), Matchers.any(EthTypeCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class)), Matchers.any(NspCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113)), Matchers.any(NspCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class)), Matchers.any(Nshc1Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115)), Matchers.any(Nshc1Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class)), Matchers.any(Nshc2Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116)), Matchers.any(Nshc2Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class)), Matchers.any(Nshc3Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117)), Matchers.any(Nshc3Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class)), Matchers.any(Nshc4Codec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118)), Matchers.any(Nshc4Codec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class)), Matchers.any(NsiCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114)), Matchers.any(NsiCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)), Matchers.any(TunIpv4DstCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)), Matchers.any(TunIpv4DstCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)), Matchers.any(TunIpv4SrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)), Matchers.any(TunIpv4SrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)), Matchers.any(TcpSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)), Matchers.any(TcpSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)), Matchers.any(TcpDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)), Matchers.any(TcpDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)), Matchers.any(UdpSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)), Matchers.any(UdpSrcCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)), Matchers.any(UdpDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)), Matchers.any(UdpDstCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)), Matchers.any(CtStateCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)), Matchers.any(CtStateCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)), Matchers.any(CtZoneCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)), Matchers.any(CtZoneCodec.class));
-        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)), Matchers.any(CtMarkCodec.class));
-        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)), Matchers.any(CtMarkCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)),
+                Matchers.any(RegLoadCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)),
+                Matchers.any(RegLoadCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)),
+                Matchers.any(RegMoveCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)),
+                Matchers.any(RegMoveCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)),
+                Matchers.any(OutputRegCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)),
+                Matchers.any(OutputRegCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)),
+                Matchers.any(ResubmitCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)),
+                Matchers.any(ResubmitCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)),
+                Matchers.any(ResubmitCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)),
+                Matchers.any(MultipathCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)),
+                Matchers.any(MultipathCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38)),
+                Matchers.any(PushNshCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class)),
+                Matchers.any(PushNshCodec.class));
+        Mockito.verify(registrator).registerActionDeserializer(
+                Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39)),
+                Matchers.any(PopNshCodec.class));
+        Mockito.verify(registrator).registerActionSerializer(
+                Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class)),
+                Matchers.any(PopNshCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)),
+                Matchers.any(Reg0Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)),
+                Matchers.any(Reg0Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)),
+                Matchers.any(Reg1Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)),
+                Matchers.any(Reg1Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)),
+                Matchers.any(Reg2Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)),
+                Matchers.any(Reg2Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)),
+                Matchers.any(Reg3Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)),
+                Matchers.any(Reg3Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)),
+                Matchers.any(Reg4Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)),
+                Matchers.any(Reg4Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)),
+                Matchers.any(Reg5Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)),
+                Matchers.any(Reg5Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)),
+                Matchers.any(Reg6Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)),
+                Matchers.any(Reg6Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)),
+                Matchers.any(Reg7Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)),
+                Matchers.any(Reg7Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)),
+                Matchers.any(TunIdCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)),
+                Matchers.any(TunIdCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)),
+                Matchers.any(ArpOpCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)),
+                Matchers.any(ArpOpCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)),
+                Matchers.any(ArpShaCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)),
+                Matchers.any(ArpShaCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)),
+                Matchers.any(ArpSpaCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)),
+                Matchers.any(ArpSpaCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)),
+                Matchers.any(ArpThaCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)),
+                Matchers.any(ArpThaCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)),
+                Matchers.any(ArpTpaCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)),
+                Matchers.any(ArpTpaCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)),
+                Matchers.any(EthDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)),
+                Matchers.any(EthDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)),
+                Matchers.any(EthSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)),
+                Matchers.any(EthSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)),
+                Matchers.any(EthTypeCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)),
+                Matchers.any(EthTypeCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class)),
+                Matchers.any(NspCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113)),
+                Matchers.any(NspCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class)),
+                Matchers.any(Nshc1Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115)),
+                Matchers.any(Nshc1Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class)),
+                Matchers.any(Nshc2Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116)),
+                Matchers.any(Nshc2Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class)),
+                Matchers.any(Nshc3Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117)),
+                Matchers.any(Nshc3Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class)),
+                Matchers.any(Nshc4Codec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118)),
+                Matchers.any(Nshc4Codec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class)),
+                Matchers.any(NsiCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114)),
+                Matchers.any(NsiCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)),
+                Matchers.any(TunIpv4DstCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)),
+                Matchers.any(TunIpv4DstCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)),
+                Matchers.any(TunIpv4SrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)),
+                Matchers.any(TunIpv4SrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)),
+                Matchers.any(TcpSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)),
+                Matchers.any(TcpSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)),
+                Matchers.any(TcpDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)),
+                Matchers.any(TcpDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)),
+                Matchers.any(UdpSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)),
+                Matchers.any(UdpSrcCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)),
+                Matchers.any(UdpDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)),
+                Matchers.any(UdpDstCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)),
+                Matchers.any(CtStateCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)),
+                Matchers.any(CtStateCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)),
+                Matchers.any(CtZoneCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)),
+                Matchers.any(CtZoneCodec.class));
+        Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+                .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)),
+                Matchers.any(CtMarkCodec.class));
+        Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+                .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)),
+                Matchers.any(CtMarkCodec.class));
     }
 
     @Test
     public void unregisterExtensionsTest() throws Exception {
         niciraExtensionsRegistrator.close();
 
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class));
-        Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class));
-        Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionConntrack.class));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106));
-        Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class));
-        Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class));
+        Mockito.verify(registrator)
+                .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class));
+        Mockito.verify(registrator).unregisterActionSerializer(
+                new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionConntrack.class));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106));
+        Mockito.verify(registrator).unregisterMatchEntrySerializer(
+                new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class));
+        Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107));
     }
 }
index a6285a7d0a88be42f61dab8a528765e48b31506d..47a046b955d8da3728798db58152d990cc0c12f2 100644 (file)
@@ -59,10 +59,9 @@ public class ActionDeserializerTest {
 
     }
 
-
     /**
      * If NiciraExtensionCodecRegistratorImpl.getActionDeserializer(actionSerializerKey) returns NULL
-     * then NULL should be returned
+     * then NULL should be returned.
      */
     @Test
     public void deserializeTest() {
@@ -71,8 +70,7 @@ public class ActionDeserializerTest {
     }
 
     /**
-     * If experimentId is different from NiciraConstants.NX_VENDOR_ID
-     * then exception should be thrown
+     * If experimentId is different from NiciraConstants.NX_VENDOR_ID then exception should be thrown.
      */
     @Test(expected = IllegalStateException.class)
     public void deserializeTest1() {
@@ -119,4 +117,4 @@ public class ActionDeserializerTest {
         niciraExtensionCodecRegistrator.registerActionDeserializer(key, deserializer);
     }
 
-}
\ No newline at end of file
+}
index 3669d1d4d1b96ce3d35e97372219f0cdbbc0e88a..d883348c12d2cb47d90463d2852c4c17fae5badb 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.openflowjava.nx.codec.action;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -69,7 +67,8 @@ public class ConntrackCodecTest {
 
         Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength, buffer.readableBytes());
         Assert.assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
-        Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength, buffer.readUnsignedShort());
+        Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength,
+                buffer.readUnsignedShort());
         Assert.assertEquals(NiciraConstants.NX_VENDOR_ID.intValue(), buffer.readUnsignedInt());
         Assert.assertEquals(nxastConntrackSubtype, buffer.readUnsignedShort());
         Assert.assertEquals(1, buffer.readUnsignedShort());
@@ -152,7 +151,7 @@ public class ConntrackCodecTest {
         Assert.assertEquals(4000, natAction.getPortMax().shortValue());
         NxActionCtMarkCase nxActionCtMarkCase = (NxActionCtMarkCase) ctActions.get(2).getOfpactActions();
         NxActionCtMark ctMarkAction = nxActionCtMarkCase.getNxActionCtMark();
-        Assert.assertEquals((long) 36, ctMarkAction.getCtMark().longValue());
+        Assert.assertEquals(36, ctMarkAction.getCtMark().longValue());
     }
 
     @Test
index e852c09604e986fcff3ea5c68c5739edb32e5002..86536016940911635dd6cfde314e5ebd70465ed5 100644 (file)
@@ -10,6 +10,8 @@ package org.opendaylight.openflowjava.nx.codec.action;
 
 import static org.junit.Assert.assertEquals;
 
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
@@ -21,20 +23,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder;
 
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-
 public class FinTimeoutCodecTest {
 
     FinTimeoutCodec finTimeoutCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 16;
-    private final byte NXAST_FIN_TIMEOUT_SUBTYPE = 19;
+    private static final int LENGTH = 16;
+    private static final byte NXAST_FIN_TIMEOUT_SUBTYPE = 19;
 
-    private final int OFP_NO_TIMEOUT = 0;
-    private final int padding = 2;
+    private static final int OFP_NO_TIMEOUT = 0;
+    private static final int PADDING = 2;
 
     @Before
     public void setUp() {
@@ -117,6 +116,6 @@ public class FinTimeoutCodecTest {
 
         message.writeShort(1);
         message.writeShort(2);
-        message.writeZero(padding);
+        message.writeZero(PADDING);
     }
-}
\ No newline at end of file
+}
index 61343cbf0e2aba87f55b2a92d2049e704de5dc11..c72dc20094dd81c097b3892b62e9f1e0907dd4ba 100644 (file)
@@ -7,13 +7,11 @@
  */
 package org.opendaylight.openflowjava.nx.codec.action;
 
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,14 +22,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder;
@@ -48,8 +43,8 @@ public class LearnCodecTest {
     private ByteBuf buffer;
     private Action action;
 
-    private final byte LEARN_HEADER_LEN = 32;
-    private final byte NXAST_LEARN_SUBTYPE = 16;
+    private static final byte LEARN_HEADER_LEN = 32;
+    private static final byte NXAST_LEARN_SUBTYPE = 16;
     private static final short SRC_MASK = 0x2000;
     private static final short DST_MASK = 0x1800;
     private static final short NUM_BITS_MASK = 0x07FF;
@@ -65,9 +60,9 @@ public class LearnCodecTest {
         action = createAction();
         learnCodec.serialize(action, buffer);
 
-        Assert.assertEquals(LEARN_HEADER_LEN+56, buffer.readableBytes());
+        Assert.assertEquals(LEARN_HEADER_LEN + 56, buffer.readableBytes());
         Assert.assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
-        Assert.assertEquals(LEARN_HEADER_LEN+56, buffer.readUnsignedShort());
+        Assert.assertEquals(LEARN_HEADER_LEN + 56, buffer.readUnsignedShort());
         Assert.assertEquals(NiciraConstants.NX_VENDOR_ID.intValue(), buffer.readUnsignedInt());
         Assert.assertEquals(NXAST_LEARN_SUBTYPE, buffer.readUnsignedShort());
         Assert.assertEquals(1, buffer.readUnsignedShort());
@@ -88,7 +83,7 @@ public class LearnCodecTest {
         action = learnCodec.deserialize(buffer);
 
         ActionLearn result = (ActionLearn) action.getActionChoice();
-        Action act= createAction();
+        Action act = createAction();
         ActionLearn expResult = (ActionLearn)act.getActionChoice();
 
         Assert.assertEquals(expResult, result);
@@ -132,7 +127,7 @@ public class LearnCodecTest {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);
-        ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
+        final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
 
         NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
         nxActionLearnBuilder.setIdleTimeout(1);
@@ -152,9 +147,9 @@ public class LearnCodecTest {
 
     private List<FlowMods> createFlowMods() {
 
-        List<FlowMods> flowMods = new ArrayList<FlowMods>();
+        final List<FlowMods> flowMods = new ArrayList<>();
         //length = 14
-        FlowModsBuilder flowMod = new FlowModsBuilder();
+        final FlowModsBuilder flowMod = new FlowModsBuilder();
         FlowModAddMatchFromFieldBuilder spec = new FlowModAddMatchFromFieldBuilder();
         spec.setFlowModNumBits(48);
         spec.setSrcField((long)9);
@@ -167,7 +162,7 @@ public class LearnCodecTest {
         flowMods.add(flowMod.build());
 
         //length = 14
-        FlowModsBuilder flowMod2 = new FlowModsBuilder();
+        final FlowModsBuilder flowMod2 = new FlowModsBuilder();
         FlowModCopyFieldIntoFieldBuilder spec2 = new FlowModCopyFieldIntoFieldBuilder();
         spec2.setFlowModNumBits(48);
         spec2.setSrcField((long)9);
@@ -180,7 +175,7 @@ public class LearnCodecTest {
         flowMods.add(flowMod2.build());
 
         //length = 10
-        FlowModsBuilder flowMod3 = new FlowModsBuilder();
+        final FlowModsBuilder flowMod3 = new FlowModsBuilder();
         FlowModCopyValueIntoFieldBuilder spec3 = new FlowModCopyValueIntoFieldBuilder();
         spec3.setFlowModNumBits(48);
         spec3.setValue(9);
@@ -192,7 +187,7 @@ public class LearnCodecTest {
         flowMods.add(flowMod3.build());
 
         //length = 10
-        FlowModsBuilder flowMod4 = new FlowModsBuilder();
+        final FlowModsBuilder flowMod4 = new FlowModsBuilder();
         FlowModAddMatchFromValueBuilder spec4 = new FlowModAddMatchFromValueBuilder();
         spec4.setFlowModNumBits(48);
         spec4.setValue(9);
@@ -204,7 +199,7 @@ public class LearnCodecTest {
         flowMods.add(flowMod4.build());
 
         //length = 8
-        FlowModsBuilder flowMod5 = new FlowModsBuilder();
+        final FlowModsBuilder flowMod5 = new FlowModsBuilder();
         FlowModOutputToPortBuilder spec5 = new FlowModOutputToPortBuilder();
         spec5.setFlowModNumBits(48);
         spec5.setSrcField((long) 9);
@@ -261,12 +256,12 @@ public class LearnCodecTest {
     }
 
     private void toFlowModSpecHeader(ByteBuf message, int src, int dst) {
-        short b = 0;
+        short value = 0;
         short bitNum = 48;
-        b |= (src << 13);
-        b |= (dst << 11);
-        b |= bitNum;
+        value |= src << 13;
+        value |= dst << 11;
+        value |= bitNum;
 
-        message.writeShort(b);
+        message.writeShort(value);
     }
-}
\ No newline at end of file
+}
index 9ff1e3de1ce645b487095fd52894846699833cb7..a7533fe93986c320c9ba2f933782aec8fde0f5e4 100644 (file)
@@ -26,15 +26,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder;
 
 public class MultipathCodecTest {
+    private static final int LENGTH = 32;
+    private static final byte NXAST_MULTIPATH_SUBTYPE = 10;
 
     MultipathCodec multipathCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 32;
-    private final byte NXAST_MULTIPATH_SUBTYPE = 10;
-
-
     @Before
     public void setUp() {
         multipathCodec = new MultipathCodec();
@@ -86,7 +84,7 @@ public class MultipathCodecTest {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);
-        ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
+        final ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
         NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
 
         nxActionMultipathBuilder.setFields(OfjNxHashFields.NXHASHFIELDSETHSRC);
@@ -132,4 +130,4 @@ public class MultipathCodecTest {
         //Dst = 5
         message.writeInt(5);
     }
-}
\ No newline at end of file
+}
index c8c6bc5d3e4c10d7d307c388604e564d809deb43..52e2a19400f8d17041785c31b83bb0158e4e1beb 100644 (file)
@@ -24,16 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder;
 
 public class OutputRegCodecTest {
+    private static final int LENGTH = 24;
+    private static final byte SUBTYPE = 15;
+    private static final byte PADDING = 6;
 
     OutputRegCodec outRegCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 24;
-    private final byte SUBTYPE = 15;
-    private final byte PADDING = 6;
-
-
     @Before
     public void setUp() {
         outRegCodec = new OutputRegCodec();
@@ -78,7 +76,7 @@ public class OutputRegCodecTest {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);
-        ActionOutputRegBuilder actionOutputRegBuilder = new ActionOutputRegBuilder();
+        final ActionOutputRegBuilder actionOutputRegBuilder = new ActionOutputRegBuilder();
         NxActionOutputRegBuilder nxActionOutputBuilder = new NxActionOutputRegBuilder();
 
         nxActionOutputBuilder.setNBits(1);
@@ -101,7 +99,5 @@ public class OutputRegCodecTest {
         message.writeInt(2);
         message.writeShort(3);
         message.writeZero(PADDING);
-
     }
-
-}
\ No newline at end of file
+}
index baa08fea70529b1c70ba2a8f8a0e95351da94ab1..301c6de00052f139c4dd4e0837a6b3b61da8d01d 100644 (file)
@@ -25,14 +25,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder;
 
 public class RegLoadCodecTest {
+    private static final int LENGTH = 24;
+    private static final byte SUBTYPE = 7;
 
     RegLoadCodec regLoadCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 24;
-    private final byte SUBTYPE = 7;
-
     @Before
     public void setUp() {
         regLoadCodec = new RegLoadCodec();
@@ -74,7 +73,7 @@ public class RegLoadCodecTest {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);
-        ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
+        final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
         NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
 
         nxActionRegLoadBuilder.setOfsNbits(1);
@@ -97,5 +96,4 @@ public class RegLoadCodecTest {
         message.writeInt(2);
         message.writeLong(3);
     }
-
-}
\ No newline at end of file
+}
index e0a4c49b6eee4a91d7bac3baf43985e26e092b2b..6947aae60c61098aed722bee78c778dae1fbf57e 100644 (file)
@@ -24,14 +24,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder;
 
 public class RegMoveCodecTest {
+    private static final int LENGTH = 24;
+    private static final byte SUBTYPE = 6;
 
     RegMoveCodec regMoveCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 24;
-    private final byte SUBTYPE = 6;
-
     @Before
     public void setUp() {
         regMoveCodec = new RegMoveCodec();
@@ -78,7 +77,7 @@ public class RegMoveCodecTest {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);
-        ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
+        final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
         NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
 
         nxActionRegMoveBuilder.setNBits(1);
@@ -106,4 +105,4 @@ public class RegMoveCodecTest {
         message.writeInt(5);
     }
 
-}
\ No newline at end of file
+}
index 28257e3b4022f835c3286b45b1033ff0f40702c2..8f91efa739b2f74ffad4ffb2b61deb9e79dc4f6f 100644 (file)
@@ -24,20 +24,18 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmitBuilder;
 
 public class ResubmitCodecTest {
+    private static final int LENGTH = 16;
+    private static final byte NXAST_RESUBMIT_SUBTYPE = 1;
+    private static final byte NXAST_RESUBMIT_TABLE_SUBTYPE = 14;
+
+    private static final short OFP_TABLE_ALL = 255;
+    private static final int OFP_IN_PORT =  0xfff8;
+    private static  final int PADDING = 3;
 
     ResubmitCodec resubmitCodec;
     ByteBuf buffer;
     Action action;
 
-    private final int LENGTH = 16;
-    private final byte NXAST_RESUBMIT_SUBTYPE = 1;
-    private final byte NXAST_RESUBMIT_TABLE_SUBTYPE = 14;
-
-    private final short OFP_TABLE_ALL = 255;
-    private final int OFP_IN_PORT =  0xfff8;
-    private final int padding = 3;
-
-
     @Before
     public void setUp() {
         resubmitCodec = new ResubmitCodec();
@@ -47,12 +45,12 @@ public class ResubmitCodecTest {
 
     /**
      * If table == null or table == OFP_TABLE_ALL
-     * SUBTYPE should be set to NXAST_RESUBMIT_SUBTYPE
+     * SUBTYPE should be set to NXAST_RESUBMIT_SUBTYPE.
      */
     @Test
     public void getSubTypeTest1() {
         action = createAction(null, null);
-        ActionResubmit actionResubmit = ((ActionResubmit) action.getActionChoice());
+        ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
 
         byte result = resubmitCodec.getSubType(actionResubmit);
         assertEquals(NXAST_RESUBMIT_SUBTYPE, result);
@@ -60,13 +58,13 @@ public class ResubmitCodecTest {
 
     /**
      * If table != null or table != OFP_TABLE_ALL
-     * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE
+     * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE.
      */
     @Test
     public void getSubTypeTest2() {
         Byte table = new Byte((byte)1);
         action = createAction(null, table);
-        ActionResubmit actionResubmit = ((ActionResubmit) action.getActionChoice());
+        ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
 
         byte result = resubmitCodec.getSubType(actionResubmit);
         assertEquals(NXAST_RESUBMIT_TABLE_SUBTYPE, result);
@@ -75,7 +73,7 @@ public class ResubmitCodecTest {
 
     /**
      * If table and inPort are NOT NULL they should be used instead of
-     * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT
+     * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT.
      */
     @Test
     public void serializeTest1() {
@@ -95,9 +93,7 @@ public class ResubmitCodecTest {
     }
 
     /**
-     * If table and inPort are NULL they
-     * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT
-     * should be used
+     * If table and inPort are NULL they hardcoded values OFP_TABLE_ALL and OFP_IN_PORT should be used.
      */
     @Test
     public void serializeTest2() {
@@ -136,10 +132,10 @@ public class ResubmitCodecTest {
         ActionResubmitBuilder actionResubmitBuilder = new ActionResubmitBuilder();
         NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
 
-        if(inPort != null) {
+        if (inPort != null) {
             nxActionResubmitBuilder.setInPort(inPort.intValue());
         }
-        if(table != null) {
+        if (table != null) {
             nxActionResubmitBuilder.setTable(table.shortValue());
         }
 
@@ -157,6 +153,6 @@ public class ResubmitCodecTest {
 
         message.writeShort(1);
         message.writeByte(2);
-        message.writeZero(padding);
+        message.writeZero(PADDING);
     }
-}
\ No newline at end of file
+}
index 8ab84fcad025bf95b8b5ebcc82a3532ad3897e5a..01931a66e34c4cc2f12d0dee2e1277d99c0ddf32 100644 (file)
@@ -58,7 +58,7 @@ public class ArpOpCodecTest {
 
         input = arpOpCodec.deserialize(buffer);
 
-        ArpOpCaseValue result = ((ArpOpCaseValue) input.getMatchEntryValue());
+        final ArpOpCaseValue result = (ArpOpCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpOp.class, input.getOxmMatchField());
@@ -71,8 +71,8 @@ public class ArpOpCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        ArpOpCaseValueBuilder caseBuilder = new ArpOpCaseValueBuilder();
-        ArpOpValuesBuilder valuesBuilder = new ArpOpValuesBuilder();
+        final ArpOpCaseValueBuilder caseBuilder = new ArpOpCaseValueBuilder();
+        final ArpOpValuesBuilder valuesBuilder = new ArpOpValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfArpOp.class);
@@ -88,10 +88,9 @@ public class ArpOpCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeShort(2);
     }
-
-}
\ No newline at end of file
+}
index d51933f9723d3e24a3e68a724ed9218193bed392..b70aad8ec4ac4d03bec982ff2c974d3266637d1c 100644 (file)
@@ -35,7 +35,7 @@ public class ArpShaCodecTest {
     private static final int NXM_FIELD_CODE = 17;
 
     private static byte[] resAddress = new byte[VALUE_LENGTH];
-    private static final MacAddress resultAddress = new MacAddress(ByteBufUtils.macAddressToString(resAddress));
+    private static final MacAddress RESULT_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(resAddress));
 
 
     @Before
@@ -55,7 +55,7 @@ public class ArpShaCodecTest {
         assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
         assertEquals(0, fieldMask & 1);
         assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
-        assertEquals(resultAddress, ByteBufUtils.readIetfMacAddress(buffer));
+        assertEquals(RESULT_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
     }
 
     @Test
@@ -64,19 +64,19 @@ public class ArpShaCodecTest {
 
         input = arpShaCodec.deserialize(buffer);
 
-        ArpShaCaseValue result = ((ArpShaCaseValue) input.getMatchEntryValue());
+        final ArpShaCaseValue result = (ArpShaCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxArpSha.class, input.getOxmMatchField());
         assertEquals(false, input.isHasMask());
-        assertEquals(resultAddress, result.getArpShaValues().getMacAddress());
+        assertEquals(RESULT_ADDRESS, result.getArpShaValues().getMacAddress());
     }
 
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder();
-        ArpShaValuesBuilder valuesBuilder = new ArpShaValuesBuilder();
+        final ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder();
+        final ArpShaValuesBuilder valuesBuilder = new ArpShaValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxArpSha.class);
@@ -95,10 +95,9 @@ public class ArpShaCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeBytes(resAddress);
     }
-
 }
index 191c6d8b13819a8a02618207681b2ceb66b341a4..54bc93e1c088e616cd51a79e27e4f8125b7c7e32 100644 (file)
@@ -57,7 +57,7 @@ public class ArpSpaCodecTest {
         createBuffer(buffer);
         input = arpSpaCodec.deserialize(buffer);
 
-        ArpSpaCaseValue result = ((ArpSpaCaseValue) input.getMatchEntryValue());
+        final ArpSpaCaseValue result = (ArpSpaCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpSpa.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class ArpSpaCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        ArpSpaCaseValueBuilder caseBuilder = new ArpSpaCaseValueBuilder();
-        ArpSpaValuesBuilder valuesBuilder = new ArpSpaValuesBuilder();
+        final ArpSpaCaseValueBuilder caseBuilder = new ArpSpaCaseValueBuilder();
+        final ArpSpaValuesBuilder valuesBuilder = new ArpSpaValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfArpSpa.class);
@@ -85,11 +85,9 @@ public class ArpSpaCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
-
-}
\ No newline at end of file
+}
index 300852d97fffe158ac99e166ee636bcf09526317..1c38218c04a6dd481098d6bca0731a2c78fc9826 100644 (file)
@@ -34,8 +34,8 @@ public class ArpThaCodecTest {
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 18;
 
-    private static final byte[] testAddr = new byte[VALUE_LENGTH];
-    private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+    private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+    private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
 
     @Before
     public void setUp() {
@@ -53,7 +53,7 @@ public class ArpThaCodecTest {
         assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
         assertEquals(0, fieldMask & 1);
         assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
-        assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+        assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
     }
 
     @Test
@@ -61,18 +61,18 @@ public class ArpThaCodecTest {
         createBuffer(buffer);
         input = arpThaCodec.deserialize(buffer);
 
-        ArpThaCaseValue result = ((ArpThaCaseValue) input.getMatchEntryValue());
+        final ArpThaCaseValue result = (ArpThaCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxArpTha.class, input.getOxmMatchField());
         assertEquals(false, input.isHasMask());
-        assertEquals(testAddress, result.getArpThaValues().getMacAddress());
+        assertEquals(TEST_ADDRESS, result.getArpThaValues().getMacAddress());
     }
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder();
-        ArpThaValuesBuilder valuesBuilder = new ArpThaValuesBuilder();
+        final ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder();
+        final ArpThaValuesBuilder valuesBuilder = new ArpThaValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxArpTha.class);
@@ -90,9 +90,9 @@ public class ArpThaCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
-        message.writeBytes(testAddr);
+        message.writeBytes(TEST_ADDR);
     }
 }
index 3cbb9dd41587ea832e8954530b055dd5cc51632c..dfbf04f6724b24633fd047d57a25091f3bb9a7db 100644 (file)
@@ -56,7 +56,7 @@ public class ArpTpaCodecTest {
         createBuffer(buffer);
         input = arpTpaCodec.deserialize(buffer);
 
-        ArpTpaCaseValue result = ((ArpTpaCaseValue) input.getMatchEntryValue());
+        final ArpTpaCaseValue result = (ArpTpaCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpTpa.class, input.getOxmMatchField());
@@ -66,8 +66,8 @@ public class ArpTpaCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        ArpTpaCaseValueBuilder caseBuilder = new ArpTpaCaseValueBuilder();
-        ArpTpaValuesBuilder valuesBuilder = new ArpTpaValuesBuilder();
+        final ArpTpaCaseValueBuilder caseBuilder = new ArpTpaCaseValueBuilder();
+        final ArpTpaValuesBuilder valuesBuilder = new ArpTpaValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfArpTpa.class);
@@ -83,10 +83,9 @@ public class ArpTpaCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
-}
\ No newline at end of file
+}
index 11315d6828946efd8bfd6a0ea3ae05350c55b4c6..d2d560b233e801da57c462e708d1edae2f4d7462 100644 (file)
@@ -57,7 +57,7 @@ public class CtStateCodecTest {
         createBuffer(buffer);
         input = ctStateCodec.deserialize(buffer);
 
-        CtStateCaseValue result = ((CtStateCaseValue) input.getMatchEntryValue());
+        final CtStateCaseValue result = (CtStateCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtState.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class CtStateCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
-        CtStateValuesBuilder valuesBuilder = new CtStateValuesBuilder();
+        final CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
+        final CtStateValuesBuilder valuesBuilder = new CtStateValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxCtState.class);
@@ -86,7 +86,7 @@ public class CtStateCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         //CtState = 1
@@ -94,5 +94,4 @@ public class CtStateCodecTest {
         //Mask = 2
         message.writeInt(2);
     }
-
-}
\ No newline at end of file
+}
index 4c82e2f5fb2a14373185c2a7ed168ccb658198f3..cde4b403261e81edb9f63a2d7f4641c158e11606 100644 (file)
@@ -58,7 +58,7 @@ public class CtZoneCodecTest {
         createBuffer(buffer);
         input = ctZoneCodec.deserialize(buffer);
 
-        CtZoneCaseValue result = ((CtZoneCaseValue) input.getMatchEntryValue());
+        final CtZoneCaseValue result = (CtZoneCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtZone.class, input.getOxmMatchField());
@@ -69,8 +69,8 @@ public class CtZoneCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
-        CtZoneValuesBuilder valuesBuilder = new CtZoneValuesBuilder();
+        final CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
+        final CtZoneValuesBuilder valuesBuilder = new CtZoneValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxCtZone.class);
@@ -86,9 +86,9 @@ public class CtZoneCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeShort(2);
     }
-}
\ No newline at end of file
+}
index 20175bdc9b2b50efe3367ae9c818d9d288a904ca..649050a10f3aa2b54b1da85c39a6075d88ced7f3 100644 (file)
@@ -34,8 +34,8 @@ public class EthDstCodecTest {
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 1;
 
-    private static final byte[] testAddr = new byte[VALUE_LENGTH];
-    private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+    private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+    private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
 
     @Before
     public void setUp() {
@@ -53,7 +53,7 @@ public class EthDstCodecTest {
         assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
         assertEquals(0, fieldMask & 1);
         assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
-        assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+        assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
     }
 
     @Test
@@ -62,20 +62,20 @@ public class EthDstCodecTest {
 
         input = ethDstCodec.deserialize(buffer);
 
-        EthDstCaseValue result = ((EthDstCaseValue) input.getMatchEntryValue());
+        final EthDstCaseValue result = (EthDstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthDst.class, input.getOxmMatchField());
         assertEquals(false, input.isHasMask());
-        assertEquals(testAddress, result.getEthDstValues().getMacAddress());
+        assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
     }
 
 
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder();
-        EthDstValuesBuilder valuesBuilder = new EthDstValuesBuilder();
+        final EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder();
+        final EthDstValuesBuilder valuesBuilder = new EthDstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfEthDst.class);
@@ -93,9 +93,9 @@ public class EthDstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
-        message.writeBytes(testAddr);
+        message.writeBytes(TEST_ADDR);
     }
 }
index ea2272eccbd3dcf550f33d8f33cc2e1d3c16e2d6..24928b7a5424edd79081a39a52615865cb1e5ca1 100644 (file)
@@ -35,8 +35,8 @@ public class EthSrcCodecTest {
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 2;
 
-    private static final byte[] testAddr = new byte[VALUE_LENGTH];
-    private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+    private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+    private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
 
     @Before
     public void setUp() {
@@ -54,7 +54,7 @@ public class EthSrcCodecTest {
         assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
         assertEquals(0, fieldMask & 1);
         assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
-        assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+        assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
     }
 
     @Test
@@ -63,20 +63,20 @@ public class EthSrcCodecTest {
 
         input = ethSrcCodec.deserialize(buffer);
 
-        EthSrcCaseValue result = ((EthSrcCaseValue) input.getMatchEntryValue());
+        final EthSrcCaseValue result = (EthSrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthSrc.class, input.getOxmMatchField());
         assertEquals(false, input.isHasMask());
-        assertEquals(testAddress, result.getEthSrcValues().getMacAddress());
+        assertEquals(TEST_ADDRESS, result.getEthSrcValues().getMacAddress());
     }
 
 
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder();
-        EthSrcValuesBuilder valuesBuilder = new EthSrcValuesBuilder();
+        final EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder();
+        final EthSrcValuesBuilder valuesBuilder = new EthSrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfEthDst.class);
@@ -95,11 +95,9 @@ public class EthSrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
-        message.writeBytes(testAddr);
+        message.writeBytes(TEST_ADDR);
     }
-
-
 }
index ccdccdff3170605394ba07dfc930beeb1e835730..7cdc20316603fed3ccc00e0ffc9007b0cbb97382 100644 (file)
@@ -57,7 +57,7 @@ public class EthTypeCodecTest {
 
         input = ethTypeCodec.deserialize(buffer);
 
-        EthTypeCaseValue result = ((EthTypeCaseValue) input.getMatchEntryValue());
+        final EthTypeCaseValue result = (EthTypeCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthType.class, input.getOxmMatchField());
@@ -69,8 +69,8 @@ public class EthTypeCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        EthTypeCaseValueBuilder caseBuilder = new EthTypeCaseValueBuilder();
-        EthTypeValuesBuilder valuesBuilder = new EthTypeValuesBuilder();
+        final EthTypeCaseValueBuilder caseBuilder = new EthTypeCaseValueBuilder();
+        final EthTypeValuesBuilder valuesBuilder = new EthTypeValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfEthType.class);
@@ -86,9 +86,9 @@ public class EthTypeCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeShort(2);
     }
-}
\ No newline at end of file
+}
index c9e049667ffd3103a61f0690d880365f0d3a21f0..db4d936011721f8310cae9d2a5a2e8cccb53ebc1 100644 (file)
@@ -57,7 +57,7 @@ public class IcmpTypeCodecTest {
 
         input = icmpTypeCodec.deserialize(buffer);
 
-        IcmpTypeCaseValue result = ((IcmpTypeCaseValue) input.getMatchEntryValue());
+        final IcmpTypeCaseValue result = (IcmpTypeCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIcmpType.class, input.getOxmMatchField());
@@ -70,8 +70,8 @@ public class IcmpTypeCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        IcmpTypeCaseValueBuilder caseBuilder = new IcmpTypeCaseValueBuilder();
-        IcmpTypeValuesBuilder valuesBuilder = new IcmpTypeValuesBuilder();
+        final IcmpTypeCaseValueBuilder caseBuilder = new IcmpTypeCaseValueBuilder();
+        final IcmpTypeValuesBuilder valuesBuilder = new IcmpTypeValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfIcmpType.class);
@@ -87,10 +87,9 @@ public class IcmpTypeCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeByte(2);
     }
-
-}
\ No newline at end of file
+}
index 33e44460d7896d000999dc606dc6208e8238dd61..998dd55803918321ff8398a7c41cfa959b06dc4a 100644 (file)
@@ -57,7 +57,7 @@ public class IpDstCodecTest {
 
         input = ipDstCodec.deserialize(buffer);
 
-        IpDstCaseValue result = ((IpDstCaseValue) input.getMatchEntryValue());
+        final IpDstCaseValue result = (IpDstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class IpDstCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
-        IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
+        final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
+        final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfIpDst.class);
@@ -85,10 +85,9 @@ public class IpDstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
-}
\ No newline at end of file
+}
index 3c511c21330188d71c8bf80b9c2e3b2d9e7a860c..a511c8219b61296d52fe1f0325596ef654ef54c6 100644 (file)
@@ -57,7 +57,7 @@ public class IpSrcCodecTest {
 
         input = ipSrcCodec.deserialize(buffer);
 
-        IpSrcCaseValue result = ((IpSrcCaseValue) input.getMatchEntryValue());
+        final IpSrcCaseValue result = (IpSrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class IpSrcCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
-        IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
+        final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
+        final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfIpSrc.class);
@@ -84,10 +84,9 @@ public class IpSrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
-}
\ No newline at end of file
+}
index 610d197ae35347b12895dcc4520d6fae2f5902c3..94ff7ffe023b5b7473935363a0bdc1183b5b2e11 100644 (file)
@@ -57,7 +57,7 @@ public class Ipv6DstCodecTest {
 
         input = ipv6DstCodec.deserialize(buffer);
 
-        IpDstCaseValue result = ((IpDstCaseValue) input.getMatchEntryValue());
+        final IpDstCaseValue result = (IpDstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Ipv6DstCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
-        IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
+        final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
+        final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfIpDst.class);
@@ -85,10 +85,9 @@ public class Ipv6DstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
 }
index 0bcb24bf6d093a1cf376fd212b7007af1ecdc55d..db42ea4c1d2d87a608e285c2b3d30be6299582a0 100644 (file)
@@ -57,7 +57,7 @@ public class Ipv6SrcCodecTest {
 
         input = ipv6SrcCodec.deserialize(buffer);
 
-        IpSrcCaseValue result = ((IpSrcCaseValue) input.getMatchEntryValue());
+        final IpSrcCaseValue result = (IpSrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Ipv6SrcCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
-        IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
+        final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
+        final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfIpSrc.class);
@@ -84,10 +84,9 @@ public class Ipv6SrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
 }
index 0cd19fa2276058c99a289bed3e6e5ce90f5c267c..b0f2051a2354ee429ba46dadfed2bc131b1e7a6a 100644 (file)
@@ -33,7 +33,7 @@ public class Nshc1CodecTest {
     private static final int NXM_FIELD_CODE = 115;
 
     @Before
-    public void setUp(){
+    public void setUp() {
         nshc1Codec = new Nshc1Codec();
         buffer = ByteBufAllocator.DEFAULT.buffer();
     }
@@ -57,7 +57,7 @@ public class Nshc1CodecTest {
 
         input = nshc1Codec.deserialize(buffer);
 
-        Nshc1CaseValue result = ((Nshc1CaseValue) input.getMatchEntryValue());
+        final Nshc1CaseValue result = (Nshc1CaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNshc1.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Nshc1CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        Nshc1CaseValueBuilder caseBuilder = new Nshc1CaseValueBuilder();
-        Nshc1ValuesBuilder valuesBuilder = new Nshc1ValuesBuilder();
+        final Nshc1CaseValueBuilder caseBuilder = new Nshc1CaseValueBuilder();
+        final Nshc1ValuesBuilder valuesBuilder = new Nshc1ValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNshc1.class);
@@ -85,10 +85,9 @@ public class Nshc1CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
     }
-
 }
index 8ddc5ab237081c6006c1a399cc43c60cffd2cf4d..f7c4beef500cbd10c2c1626d8450f76a3f247472 100644 (file)
@@ -58,7 +58,7 @@ public class Nshc2CodecTest {
 
         input = nshc2Codec.deserialize(buffer);
 
-        Nshc2CaseValue result = ((Nshc2CaseValue) input.getMatchEntryValue());
+        final Nshc2CaseValue result = (Nshc2CaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNshc2.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Nshc2CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        Nshc2CaseValueBuilder caseBuilder = new Nshc2CaseValueBuilder();
-        Nshc2ValuesBuilder valuesBuilder = new Nshc2ValuesBuilder();
+        final Nshc2CaseValueBuilder caseBuilder = new Nshc2CaseValueBuilder();
+        final Nshc2ValuesBuilder valuesBuilder = new Nshc2ValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNshc2.class);
@@ -85,7 +85,7 @@ public class Nshc2CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
index 50a1afff4692d20012ac568626b429d92bb0eea9..de85ef97ca59a2381298711a22838900ff037cd3 100644 (file)
@@ -57,7 +57,7 @@ public class Nshc3CodecTest {
 
         input = nshc3Codec.deserialize(buffer);
 
-        Nshc3CaseValue result = ((Nshc3CaseValue) input.getMatchEntryValue());
+        final Nshc3CaseValue result = (Nshc3CaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNshc3.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Nshc3CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        Nshc3CaseValueBuilder caseBuilder = new Nshc3CaseValueBuilder();
-        Nshc3ValuesBuilder valuesBuilder = new Nshc3ValuesBuilder();
+        final Nshc3CaseValueBuilder caseBuilder = new Nshc3CaseValueBuilder();
+        final Nshc3ValuesBuilder valuesBuilder = new Nshc3ValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNshc3.class);
@@ -85,7 +85,7 @@ public class Nshc3CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
index b5649c688a0cec54fe26a6ea401d2c6d181b1e79..86a09786ed320bc3ab33fca752ec839a411ae496 100644 (file)
@@ -57,7 +57,7 @@ public class Nshc4CodecTest {
 
         input = nshc4Codec.deserialize(buffer);
 
-        Nshc4CaseValue result = ((Nshc4CaseValue) input.getMatchEntryValue());
+        final Nshc4CaseValue result = (Nshc4CaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNshc4.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Nshc4CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        Nshc4CaseValueBuilder caseBuilder = new Nshc4CaseValueBuilder();
-        Nshc4ValuesBuilder valuesBuilder = new Nshc4ValuesBuilder();
+        final Nshc4CaseValueBuilder caseBuilder = new Nshc4CaseValueBuilder();
+        final Nshc4ValuesBuilder valuesBuilder = new Nshc4ValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNshc4.class);
@@ -85,7 +85,7 @@ public class Nshc4CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
index a7e145b160585fede1f622e9cfed74e2a330f0db..c935b99bf0175e6ee1c7f5648eb794e6232c6833 100644 (file)
@@ -57,7 +57,7 @@ public class NsiCodecTest {
 
         input = nsiCodec.deserialize(buffer);
 
-        NsiCaseValue result = ((NsiCaseValue) input.getMatchEntryValue());
+        final NsiCaseValue result = (NsiCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNsi.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class NsiCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        NsiCaseValueBuilder caseBuilder = new NsiCaseValueBuilder();
-        NsiValuesBuilder valuesBuilder = new NsiValuesBuilder();
+        final NsiCaseValueBuilder caseBuilder = new NsiCaseValueBuilder();
+        final NsiValuesBuilder valuesBuilder = new NsiValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNsi.class);
@@ -85,7 +85,7 @@ public class NsiCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeByte(2);
index de50c402c8582951b84eb9bf846d471e680acee0..e2e84b6d162eb4f09338adb1f23ff48155a0b9af 100644 (file)
@@ -57,7 +57,7 @@ public class NspCodecTest {
 
         input = nspCodec.deserialize(buffer);
 
-        NspCaseValue result = ((NspCaseValue) input.getMatchEntryValue());
+        final NspCaseValue result = (NspCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxNsp.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class NspCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        NspCaseValueBuilder caseBuilder = new NspCaseValueBuilder();
-        NspValuesBuilder valuesBuilder = new NspValuesBuilder();
+        final NspCaseValueBuilder caseBuilder = new NspCaseValueBuilder();
+        final NspValuesBuilder valuesBuilder = new NspValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxNsp.class);
@@ -85,7 +85,7 @@ public class NspCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(2);
index e05d0b13dde506ffa3b94a5d2c46453ce7d0974b..47a58644c439be32e14b6f38a44b7d436bb7578d 100644 (file)
@@ -24,7 +24,7 @@ public class NxmHeaderTest {
     private static final int VALUE_LENGTH = 14;
 
     @Test
-    public void NxmHeaderTest() {
+    public void nxmHeaderTest() {
         header = createHeader();
         nxmHeader = new NxmHeader(header);
 
@@ -61,12 +61,9 @@ public class NxmHeaderTest {
         header = createHeader();
         nxmHeader = new NxmHeader(header);
 
-        String shouldBe = new String("NxmHeader " +
-                                        "[headerAsLong=" + header + ", " +
-                                        "oxmClass=" + OxmMatchConstants.NXM_1_CLASS + "," +
-                                        " nxmField=" + NXM_FIELD_CODE + "," +
-                                        " hasMask=" + false + "," +
-                                        " length=" + VALUE_LENGTH + "]");
+        String shouldBe = new String("NxmHeader " + "[headerAsLong=" + header + ", " + "oxmClass="
+                + OxmMatchConstants.NXM_1_CLASS + "," + " nxmField=" + NXM_FIELD_CODE + "," + " hasMask=" + false + ","
+                + " length=" + VALUE_LENGTH + "]");
 
         assertEquals(shouldBe, nxmHeader.toString());
     }
@@ -85,4 +82,4 @@ public class NxmHeaderTest {
 
         return result;
     }
-}
\ No newline at end of file
+}
index bea66d37b594eb8621efd6881fde4131e0c4c3ff..b01413e49a33d3f8d539fd3446d6ed9ebd6f7990 100644 (file)
@@ -57,7 +57,7 @@ public class Reg0CodecTest {
 
         input = reg0Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg0.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Reg0CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg0.class);
@@ -84,10 +84,9 @@ public class Reg0CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index 8650e2c3fe13105f5005e0c844f85d6f54d10e0f..62aa7229d951d241d8a3829bcf44ab556f7d0a27 100644 (file)
@@ -57,7 +57,7 @@ public class Reg1CodecTest {
 
         input = reg1Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg1.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Reg1CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg1.class);
@@ -84,10 +84,9 @@ public class Reg1CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index c96aa2b58c7419feb5aaef2daa1406a5cc494121..b1e83dd11d96676a76f0cbf59458fd0fb98c9ec6 100644 (file)
@@ -56,7 +56,7 @@ public class Reg2CodecTest {
 
         input = reg2Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg2.class, input.getOxmMatchField());
@@ -66,8 +66,8 @@ public class Reg2CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg2.class);
@@ -83,9 +83,9 @@ public class Reg2CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-}
\ No newline at end of file
+}
index 14f9cf0ecadc8106d91efdbe2d1930ebc966718e..a089990e828ff0956a5497386ca81566627a8ab4 100644 (file)
@@ -58,7 +58,7 @@ public class Reg3CodecTest {
 
         input = reg3Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg3.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Reg3CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg3.class);
@@ -85,10 +85,9 @@ public class Reg3CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index 3f8f52d79b4f13ee14db9431475d47fdb8ed16a1..3c178f94d1e06abaf469832df84885b97c7eb328 100644 (file)
@@ -57,7 +57,7 @@ public class Reg4CodecTest {
 
         input = reg4Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg4.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Reg4CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg4.class);
@@ -84,10 +84,9 @@ public class Reg4CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index 4a0f47d7d7c1ad1c43c7906d0df190ad8b494d83..688bfd7a55bc2bd706d2710a92c7c3ba1e49d723 100644 (file)
@@ -58,7 +58,7 @@ public class Reg5CodecTest {
 
         input = reg5Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg5.class, input.getOxmMatchField());
@@ -68,8 +68,8 @@ public class Reg5CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg5.class);
@@ -85,10 +85,9 @@ public class Reg5CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index a567a41ff11d0d16f5e8cdf2005c80981ec8db63..b03b9f76c50f6e0e57e9fcfedfc466a33dad59de 100644 (file)
@@ -57,7 +57,7 @@ public class Reg6CodecTest {
 
         input = reg6Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg6.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Reg6CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg6.class);
@@ -84,9 +84,9 @@ public class Reg6CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-}
\ No newline at end of file
+}
index 1d12379e6f1330fd4882e43878c5a16776e212fb..c4534029ddd4c9002aa5409f8df99b045095df7a 100644 (file)
@@ -57,7 +57,7 @@ public class Reg7CodecTest {
 
         input = reg7Codec.deserialize(buffer);
 
-        RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+        final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg7.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class Reg7CodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
-        RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+        final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+        final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxReg7.class);
@@ -84,10 +84,9 @@ public class Reg7CodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index 11ae81ea5fec2f026238d1618c397ec8691fe028..84d88b4a94f2a9bd7ff2baeae0f0cce57a66cece 100644 (file)
@@ -59,7 +59,7 @@ public class TcpDstCodecTest {
 
         input = tcpDstCodec.deserialize(buffer);
 
-        TcpDstCaseValue result = ((TcpDstCaseValue) input.getMatchEntryValue());
+        final TcpDstCaseValue result = (TcpDstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfTcpDst.class, input.getOxmMatchField());
@@ -71,8 +71,8 @@ public class TcpDstCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        TcpDstCaseValueBuilder caseBuilder = new TcpDstCaseValueBuilder();
-        TcpDstValuesBuilder valuesBuilder = new TcpDstValuesBuilder();
+        final TcpDstCaseValueBuilder caseBuilder = new TcpDstCaseValueBuilder();
+        final TcpDstValuesBuilder valuesBuilder = new TcpDstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfTcpDst.class);
@@ -89,12 +89,11 @@ public class TcpDstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         //Port num = 1
         message.writeShort(1);
         message.writeShort(0xffff);
     }
-
 }
index 124d2bddec166d835ce1319d0042e53d52e173a2..a6574302b61729b8eebc9efba9800eba380b73fb 100644 (file)
@@ -34,7 +34,7 @@ public class TcpSrcCodecTest {
     private static final int NXM_FIELD_CODE = 9;
 
     @Before
-    public void setUp(){
+    public void setUp() {
         tcpSrcCodec = new TcpSrcCodec();
         buffer = ByteBufAllocator.DEFAULT.buffer();
     }
@@ -59,7 +59,7 @@ public class TcpSrcCodecTest {
 
         input = tcpSrcCodec.deserialize(buffer);
 
-        TcpSrcCaseValue result = ((TcpSrcCaseValue) input.getMatchEntryValue());
+        final TcpSrcCaseValue result = (TcpSrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfTcpSrc.class, input.getOxmMatchField());
@@ -70,8 +70,8 @@ public class TcpSrcCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        TcpSrcCaseValueBuilder caseBuilder = new TcpSrcCaseValueBuilder();
-        TcpSrcValuesBuilder valuesBuilder = new TcpSrcValuesBuilder();
+        final TcpSrcCaseValueBuilder caseBuilder = new TcpSrcCaseValueBuilder();
+        final TcpSrcValuesBuilder valuesBuilder = new TcpSrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfTcpSrc.class);
@@ -88,12 +88,11 @@ public class TcpSrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         //Port num = 1
         message.writeShort(1);
         message.writeShort(0xffff);
     }
-
 }
index e1802ab3b9509bb2cf38ed1f8760d8b8242ed4b5..af93720247095ecb8617efaceb02dfa68e01148c 100644 (file)
@@ -58,7 +58,7 @@ public class TunIdCodecTest {
 
         input = tunIdCodec.deserialize(buffer);
 
-        TunIdCaseValue result = ((TunIdCaseValue) input.getMatchEntryValue());
+        final TunIdCaseValue result = (TunIdCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunId.class, input.getOxmMatchField());
@@ -70,8 +70,8 @@ public class TunIdCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        TunIdCaseValueBuilder caseBuilder = new TunIdCaseValueBuilder();
-        TunIdValuesBuilder valuesBuilder = new TunIdValuesBuilder();
+        final TunIdCaseValueBuilder caseBuilder = new TunIdCaseValueBuilder();
+        final TunIdValuesBuilder valuesBuilder = new TunIdValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxTunId.class);
@@ -88,11 +88,10 @@ public class TunIdCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         byte[] value = new byte[VALUE_LENGTH];
         message.writeLong(new BigInteger(value).longValue());
     }
-
-}
\ No newline at end of file
+}
index 085622d24b8428b60e6694d4740180568ed92f89..238fd891e2f73caa150a60f81ad71e05d7c536c1 100644 (file)
@@ -57,7 +57,7 @@ public class TunIpv4DstCodecTest {
 
         input = tunIpv4DstCodec.deserialize(buffer);
 
-        TunIpv4DstCaseValue result = ((TunIpv4DstCaseValue) input.getMatchEntryValue());
+        final TunIpv4DstCaseValue result = (TunIpv4DstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunIpv4Dst.class, input.getOxmMatchField());
@@ -69,8 +69,8 @@ public class TunIpv4DstCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        TunIpv4DstCaseValueBuilder caseBuilder = new TunIpv4DstCaseValueBuilder();
-        TunIpv4DstValuesBuilder valuesBuilder = new TunIpv4DstValuesBuilder();
+        final TunIpv4DstCaseValueBuilder caseBuilder = new TunIpv4DstCaseValueBuilder();
+        final TunIpv4DstValuesBuilder valuesBuilder = new TunIpv4DstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxTunIpv4Dst.class);
@@ -86,10 +86,9 @@ public class TunIpv4DstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-}
\ No newline at end of file
+}
index 9c455d9f39944e0becf9f110474fbd085a548e16..89f8d1d244c519af914e1d2882fde4b2585fddd7 100644 (file)
@@ -57,7 +57,7 @@ public class TunIpv4SrcCodecTest {
 
         input = tunIpv4SrcCodec.deserialize(buffer);
 
-        TunIpv4SrcCaseValue result = ((TunIpv4SrcCaseValue) input.getMatchEntryValue());
+        final TunIpv4SrcCaseValue result = (TunIpv4SrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunIpv4Src.class, input.getOxmMatchField());
@@ -67,8 +67,8 @@ public class TunIpv4SrcCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        TunIpv4SrcCaseValueBuilder caseBuilder = new TunIpv4SrcCaseValueBuilder();
-        TunIpv4SrcValuesBuilder valuesBuilder = new TunIpv4SrcValuesBuilder();
+        final TunIpv4SrcCaseValueBuilder caseBuilder = new TunIpv4SrcCaseValueBuilder();
+        final TunIpv4SrcValuesBuilder valuesBuilder = new TunIpv4SrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm1Class.class);
         matchEntryBuilder.setOxmMatchField(NxmNxTunIpv4Src.class);
@@ -84,11 +84,9 @@ public class TunIpv4SrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         message.writeInt(1);
     }
-
-
-}
\ No newline at end of file
+}
index 58bcff6d5ee9fd3d4f7ea1af539671395b9f8836..0fff052d1e5997fa608f3161b258a6b66d6836f8 100644 (file)
@@ -59,7 +59,7 @@ public class UdpDstCodecTest {
 
         input = udpDstCodec.deserialize(buffer);
 
-        UdpDstCaseValue result = ((UdpDstCaseValue) input.getMatchEntryValue());
+        final UdpDstCaseValue result = (UdpDstCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfUdpDst.class, input.getOxmMatchField());
@@ -71,8 +71,8 @@ public class UdpDstCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        UdpDstCaseValueBuilder caseBuilder = new UdpDstCaseValueBuilder();
-        UdpDstValuesBuilder valuesBuilder = new UdpDstValuesBuilder();
+        final UdpDstCaseValueBuilder caseBuilder = new UdpDstCaseValueBuilder();
+        final UdpDstValuesBuilder valuesBuilder = new UdpDstValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfUdpDst.class);
@@ -89,7 +89,7 @@ public class UdpDstCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         //Port num = 1
index 66b0aa210da925685deb479aee3d49ce8206529a..e6a1aad5e779ccb6d6990699f52494c5e68c7e19 100644 (file)
@@ -59,7 +59,7 @@ public class UdpSrcCodecTest {
 
         input = udpSrcCodec.deserialize(buffer);
 
-        UdpSrcCaseValue result = ((UdpSrcCaseValue) input.getMatchEntryValue());
+        final UdpSrcCaseValue result = (UdpSrcCaseValue) input.getMatchEntryValue();
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfUdpSrc.class, input.getOxmMatchField());
@@ -70,8 +70,8 @@ public class UdpSrcCodecTest {
 
     private MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
-        UdpSrcCaseValueBuilder caseBuilder = new UdpSrcCaseValueBuilder();
-        UdpSrcValuesBuilder valuesBuilder = new UdpSrcValuesBuilder();
+        final UdpSrcCaseValueBuilder caseBuilder = new UdpSrcCaseValueBuilder();
+        final UdpSrcValuesBuilder valuesBuilder = new UdpSrcValuesBuilder();
 
         matchEntryBuilder.setOxmClass(Nxm0Class.class);
         matchEntryBuilder.setOxmMatchField(NxmOfUdpSrc.class);
@@ -88,12 +88,11 @@ public class UdpSrcCodecTest {
     private void createBuffer(ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
-        int fieldMask = (NXM_FIELD_CODE << 1);
+        int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
         message.writeByte(VALUE_LENGTH);
         //Port num = 1
         message.writeShort(1);
         message.writeShort(0xffff);
     }
-
 }