Final round of isFoo() migration 29/94329/7
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 1 Jan 2021 21:51:20 +0000 (22:51 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 2 Jan 2021 13:51:52 +0000 (14:51 +0100)
Finish up remaining components, so that we do not use isFoo()
anywhere.

Change-Id: I4da07dd94b689176ecc07ffb64ecfc36890e73b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
66 files changed:
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowServiceImpl.java
applications/bulk-o-matic/src/test/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/BulkOMaticUtilsTest.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.java
applications/forwardingrules-manager/src/test/java/test/mock/FlowListenerTest.java
applications/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/TableForwarder.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListenerTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/FlowForwarderTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImplTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImplTest.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/NodeConnectorInventoryEventTranslator.java
applications/lldp-speaker/src/test/java/org/opendaylight/openflowplugin/applications/lldpspeaker/NodeConnectorInventoryEventTranslatorTest.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/ShowNodeCommandProvider.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/TerminationPointChangeListenerImpl.java
extension/openflowjava-extension-eric/src/main/java/org/opendaylight/openflowjava/eric/codec/match/AbstractMatchCodec.java
extension/openflowjava-extension-eric/src/test/java/org/opendaylight/openflowjava/eric/codec/match/Icmpv6NDOptionsTypeCodecTest.java
extension/openflowjava-extension-eric/src/test/java/org/opendaylight/openflowjava/eric/codec/match/Icmpv6NDReservedCodecTest.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/AbstractExperimenterMatchCodec.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/AbstractRegCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/CtMarkCodec.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/AbstractExperimenterMatchCodecTest.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/CtTpDstCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/CtTpSrcCodecTest.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/MetadataCodecTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/PktMarkCodecTest.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
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/RegConvertor.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/serializer/AbstractBundleMessageFactory.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleAddMessageConverterTest.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleControlConverterTest.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/deserializer/BundleControlFactoryTest.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java

index db58c4db2b81635c82eec33150dfffbcfa838d8a..d4392cfa25462347260839414ac3099367dfe46e 100644 (file)
@@ -99,7 +99,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     @Override
     public ListenableFuture<RpcResult<AddFlowsDsOutput>> addFlowsDs(final AddFlowsDsInput input) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        boolean createParentsNextTime = requireNonNullElse(input.isAlwaysCreateParents(), Boolean.FALSE);
+        boolean createParentsNextTime = requireNonNullElse(input.getAlwaysCreateParents(), Boolean.FALSE);
         boolean createParents = true;
         for (BulkFlowDsItem bulkFlow : input.getBulkFlowDsItem()) {
             FlowBuilder flowBuilder = new FlowBuilder(bulkFlow);
@@ -191,7 +191,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     @Override
     public ListenableFuture<RpcResult<ReadFlowTestOutput>> readFlowTest(final ReadFlowTestInput input) {
         FlowReader flowReader = FlowReader.getNewInstance(dataBroker, input.getDpnCount().intValue(),
-                input.getFlowsPerDpn().intValue(), input.isVerbose(), input.isIsConfigDs(),
+                input.getFlowsPerDpn().intValue(), input.getVerbose(), input.getIsConfigDs(),
                 input.getStartTableId().shortValue(), input.getEndTableId().shortValue());
         flowCounterBeanImpl.setReader(flowReader);
         fjService.execute(flowReader);
@@ -249,14 +249,14 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
 
     @Override
     public ListenableFuture<RpcResult<FlowTestOutput>> flowTest(final FlowTestInput input) {
-        if (input.isTxChain()) {
+        if (input.getTxChain()) {
             FlowWriterTxChain flowTester = new FlowWriterTxChain(dataBroker, fjService);
             flowCounterBeanImpl.setWriter(flowTester);
-            if (input.isIsAdd()) {
+            if (input.getIsAdd()) {
                 flowTester.addFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getSleepFor().intValue(),
                         input.getSleepAfter().intValue(), input.getStartTableId().shortValue(),
-                        input.getEndTableId().shortValue(), input.isCreateParents());
+                        input.getEndTableId().shortValue(), input.getCreateParents());
             } else {
                 flowTester.deleteFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getStartTableId().shortValue(),
@@ -265,14 +265,14 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
             RpcResultBuilder<FlowTestOutput> rpcResultBuilder = RpcResultBuilder.success();
             return Futures.immediateFuture(rpcResultBuilder.build());
         }
-        if (input.isSeq()) {
+        if (input.getSeq()) {
             FlowWriterSequential flowTester = new FlowWriterSequential(dataBroker, fjService);
             flowCounterBeanImpl.setWriter(flowTester);
-            if (input.isIsAdd()) {
+            if (input.getIsAdd()) {
                 flowTester.addFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getSleepFor().intValue(),
                         input.getStartTableId().shortValue(), input.getEndTableId().shortValue(),
-                        input.isCreateParents());
+                        input.getCreateParents());
             } else {
                 flowTester.deleteFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getStartTableId().shortValue(),
@@ -281,11 +281,11 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
         } else {
             FlowWriterConcurrent flowTester = new FlowWriterConcurrent(dataBroker, fjService);
             flowCounterBeanImpl.setWriter(flowTester);
-            if (input.isIsAdd()) {
+            if (input.getIsAdd()) {
                 flowTester.addFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getSleepFor().intValue(),
                         input.getSleepAfter().intValue(), input.getStartTableId().shortValue(),
-                        input.getEndTableId().shortValue(), input.isCreateParents());
+                        input.getEndTableId().shortValue(), input.getCreateParents());
             } else {
                 flowTester.deleteFlows(input.getDpnCount().intValue(), input.getFlowsPerDpn().intValue(),
                         input.getBatchSize().intValue(), input.getStartTableId().shortValue(),
index f640af1dbdf292676784dd576d815b115cb37a5d..b7be46ee82a109d0a35d44c96b48257a6469b2bf 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.bulk.o.matic;
 
 import org.junit.Assert;
index 4b39a21bbb9560228c131f899ed0dd018aff92c4..b5eaa2da02614a881b3fd75f73e768a9eee7f14f 100644 (file)
@@ -124,10 +124,10 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
                                       @Reference final ServiceRecoveryRegistry serviceRecoveryRegistry,
                                       @Reference final FlowGroupCacheManager flowGroupCacheManager,
                                       final ListenerRegistrationHelper registrationHelper) {
-        disableReconciliation = config.isDisableReconciliation();
-        staleMarkingEnabled = config.isStaleMarkingEnabled();
+        disableReconciliation = config.getDisableReconciliation();
+        staleMarkingEnabled = config.getStaleMarkingEnabled();
         reconciliationRetryCount = config.getReconciliationRetryCount().toJava();
-        isBundleBasedReconciliationEnabled = config.isBundleBasedReconciliationEnabled();
+        isBundleBasedReconciliationEnabled = config.getBundleBasedReconciliationEnabled();
         this.configurationServiceRegistration = configurationService.registerListener(this);
         this.registrationHelper = requireNonNull(registrationHelper, "RegistrationHelper cannot be null");
         this.dataService = requireNonNull(dataBroker, "DataBroker can not be null!");
index 46c0fe3905d4d5a3d3941d884bb5c34c24851e89..9d483803d57f9d426300e32002b0675d5674e96b 100644 (file)
@@ -166,8 +166,8 @@ public class FlowListenerTest extends FRMTest {
         assertEquals(1, updateFlowCalls.size());
         assertEquals("DOM-1", updateFlowCalls.get(0).getTransactionUri().getValue());
         assertEquals(flowII, updateFlowCalls.get(0).getFlowRef().getValue());
-        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getOriginalFlow().isStrict());
-        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getUpdatedFlow().isStrict());
+        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getOriginalFlow().getStrict());
+        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getUpdatedFlow().getStrict());
     }
 
     @Test
@@ -241,7 +241,7 @@ public class FlowListenerTest extends FRMTest {
         assertEquals(1, removeFlowCalls.size());
         assertEquals("DOM-1", removeFlowCalls.get(0).getTransactionUri().getValue());
         assertEquals(flowII, removeFlowCalls.get(0).getFlowRef().getValue());
-        assertEquals(Boolean.TRUE, removeFlowCalls.get(0).isStrict());
+        assertEquals(Boolean.TRUE, removeFlowCalls.get(0).getStrict());
     }
 
     @Test
index 06f5aa8e2276a5c096da58cf5d0431d149cc4405..51c776220fbc7f93d15c1f9a9985d52f89dd57d8 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.yangtools.yang.common.Uint16;
 
 public abstract class FRMTest extends AbstractDataBrokerTest {
 
-    public void addFlowCapableNode(NodeKey nodeKey) {
+    public void addFlowCapableNode(final NodeKey nodeKey) {
         Nodes nodes = new NodesBuilder().build();
 
         NodeBuilder nodeBuilder = new NodeBuilder();
@@ -54,11 +54,11 @@ public abstract class FRMTest extends AbstractDataBrokerTest {
 
     // TODO: remove with mdsal-3.0.7 or later
     @SuppressWarnings("unchecked")
-    protected static final void assertCommit(FluentFuture<?> future) {
+    protected static final void assertCommit(final FluentFuture<?> future) {
         assertCommit((ListenableFuture<Void>) future);
     }
 
-    public void removeNode(NodeKey nodeKey) throws ExecutionException, InterruptedException {
+    public void removeNode(final NodeKey nodeKey) throws ExecutionException, InterruptedException {
         WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
         writeTx.delete(LogicalDatastoreType.OPERATIONAL,
                 InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey));
@@ -92,21 +92,21 @@ public abstract class FRMTest extends AbstractDataBrokerTest {
         });
 
         Mockito.lenient().when(configurationService.getProperty(Mockito.eq("disable-reconciliation"), Mockito.any()))
-                .thenReturn(config.isDisableReconciliation());
+                .thenReturn(config.getDisableReconciliation());
 
         Mockito.lenient().when(configurationService.getProperty(Mockito.eq("stale-marking-enabled"), Mockito.any()))
-                .thenReturn(config.isStaleMarkingEnabled());
+                .thenReturn(config.getStaleMarkingEnabled());
 
         Mockito.lenient().when(configurationService.getProperty(Mockito.eq("reconciliation-retry-count"),
                 Mockito.any())).thenReturn(config.getReconciliationRetryCount());
 
         Mockito.lenient().when(configurationService.getProperty(Mockito.eq("bundle-based-reconciliation-enabled"),
-                Mockito.any())).thenReturn(config.isBundleBasedReconciliationEnabled());
+                Mockito.any())).thenReturn(config.getBundleBasedReconciliationEnabled());
 
         return configurationService;
     }
 
-    protected Callable<Integer> listSize(List<?> list) {
+    protected Callable<Integer> listSize(final List<?> list) {
         // The condition supplier part
         return list::size;
     }
index 3448b160b7c655e1a26c9074c517e0ee141b3d04..d2620c2b35b5a9124472af2739511e97a1fa6203 100644 (file)
@@ -190,7 +190,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
             return false;
         }
 
-        if (!gatheringStatusEnd.isSucceeded()) {
+        if (!gatheringStatusEnd.getSucceeded()) {
             LOG.trace("Statistics gathering was not successful: {}", nodeId.getValue());
             return false;
         }
index 351a86ba403de2fd876fceb4ee82c4c81e1d7b2c..6d470b4bc39b26ed68a3e86035c91d86eaae85d7 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collections;
 import org.opendaylight.openflowplugin.applications.frsync.ForwardingRulesUpdateCommitter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
@@ -24,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.tab
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -36,7 +35,7 @@ public class TableForwarder implements ForwardingRulesUpdateCommitter<TableFeatu
     private static final Logger LOG = LoggerFactory.getLogger(TableForwarder.class);
     private final SalTableService salTableService;
 
-    public TableForwarder(SalTableService salTableService) {
+    public TableForwarder(final SalTableService salTableService) {
         this.salTableService = salTableService;
     }
 
@@ -44,25 +43,17 @@ public class TableForwarder implements ForwardingRulesUpdateCommitter<TableFeatu
     public ListenableFuture<RpcResult<UpdateTableOutput>> update(final InstanceIdentifier<TableFeatures> identifier,
                                                        final TableFeatures original, final TableFeatures update,
                                                        final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-        LOG.debug("Forwarding Table Update request [Tbl id, node Id {} {}",
-                identifier, nodeIdent);
-
-        final UpdateTableInputBuilder builder = new UpdateTableInputBuilder();
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-
+        LOG.debug("Forwarding Table Update request [Tbl id, node Id {} {}", identifier, nodeIdent);
         final InstanceIdentifier<Table> iiToTable = nodeIdent.child(Table.class,
                 new TableKey(identifier.firstKeyOf(TableFeatures.class).getTableId()));
-        builder.setTableRef(new TableRef(iiToTable));
-
-        builder.setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(
-                Collections.singletonList(update)).build());
-
-        builder.setOriginalTable(new OriginalTableBuilder().setTableFeatures(
-                Collections.singletonList(original)).build());
-        LOG.debug("Invoking SalTableService {} ", nodeIdent);
 
-        return salTableService.updateTable(builder.build());
+        LOG.debug("Invoking SalTableService {}", nodeIdent);
+        return salTableService.updateTable(new UpdateTableInputBuilder()
+            .setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)))
+            .setTableRef(new TableRef(iiToTable))
+            .setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(BindingMap.of(update)).build())
+            .setOriginalTable(new OriginalTableBuilder().setTableFeatures(BindingMap.of(original)).build())
+            .build());
     }
 
 }
index 3502295cfabb3b7d51f28c320497e68b87d11de3..be4a21de52f0aaba59e1a0c73fb27043aa3e846e 100644 (file)
@@ -192,7 +192,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class))
             .thenReturn(statisticsGatheringStatus);
         Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(snapshotGatheringStatusEnd);
-        Mockito.when(snapshotGatheringStatusEnd.isSucceeded()).thenReturn(false);
+        Mockito.when(snapshotGatheringStatusEnd.getSucceeded()).thenReturn(false);
 
         nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
 
@@ -260,7 +260,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class))
              .thenReturn(statisticsGatheringStatus);
         Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(snapshotGatheringStatusEnd);
-        Mockito.when(snapshotGatheringStatusEnd.isSucceeded()).thenReturn(true);
+        Mockito.when(snapshotGatheringStatusEnd.getSucceeded()).thenReturn(true);
         Mockito.when(snapshotGatheringStatusEnd.getEnd()).thenReturn(Mockito.mock(DateAndTime.class));
         final String timestampBefore = "0000-12-12T01:01:01.000-07:00";
         final String timestampAfter = "9999-12-12T01:01:01.000-07:00";
index 21350b4484cd30fa0c41b91882aa0c97d7a936e6..6f551cf8032e6caa6a5966f3778ca6cdc991cee6 100644 (file)
@@ -117,7 +117,7 @@ public class FlowForwarderTest {
         Assert.assertEquals(null, flowInput.getInstructions());
         Assert.assertEquals(nodePath, flowInput.getNode().getValue());
         Assert.assertEquals(flowPath, flowInput.getFlowRef().getValue());
-        Assert.assertEquals(null, flowInput.isStrict());
+        Assert.assertEquals(null, flowInput.getStrict());
 
 
         final RpcResult<AddFlowOutput> addFlowOutputRpcResult = addResult.get(2, TimeUnit.SECONDS);
@@ -168,12 +168,12 @@ public class FlowForwarderTest {
         Assert.assertEquals(2, flowInput.getTableId().shortValue());
         Assert.assertEquals(emptyMatch, flowInput.getMatch());
         Assert.assertEquals(originalInstructions, flowInput.getInstructions());
-        Assert.assertEquals(true, flowInput.isStrict());
+        Assert.assertEquals(true, flowInput.getStrict());
 
         Assert.assertEquals(2, flowOrigInput.getTableId().shortValue());
         Assert.assertEquals(emptyMatch, flowOrigInput.getMatch());
         Assert.assertEquals(null, flowOrigInput.getInstructions());
-        Assert.assertEquals(true, flowOrigInput.isStrict());
+        Assert.assertEquals(true, flowOrigInput.getStrict());
 
 
         final RpcResult<UpdateFlowOutput> updateFlowOutputRpcResult = updateResult.get(2, TimeUnit.SECONDS);
@@ -199,7 +199,7 @@ public class FlowForwarderTest {
         Assert.assertEquals(2, flowInput.getTableId().shortValue());
         Assert.assertEquals(emptyMatch, flowInput.getMatch());
         Assert.assertEquals(null, flowInput.getInstructions());
-        Assert.assertEquals(true, flowInput.isStrict());
+        Assert.assertEquals(true, flowInput.getStrict());
 
 
         final RpcResult<RemoveFlowOutput> removeFlowOutputRpcResult = removeResult.get(2, TimeUnit.SECONDS);
index 2ecd2e83cfd9ad89689cb86fe2398447eac6e44c..f7a19315b0e6493b2c8961c091b3c31e0cd42871 100644 (file)
@@ -134,7 +134,7 @@ public class SyncPlanPushStrategyFlatBatchImplTest {
         Mockito.verify(flatBatchService).processFlatBatch(processFlatBatchInputCpt.capture());
 
         final ProcessFlatBatchInput processFlatBatchInput = processFlatBatchInputCpt.getValue();
-        Assert.assertFalse(processFlatBatchInput.isExitOnFirstError());
+        Assert.assertFalse(processFlatBatchInput.getExitOnFirstError());
         Assert.assertEquals(13, processFlatBatchInput.getBatch().size());
 
         Assert.assertTrue(rpcResult.isDone());
index b194454f7da5d183e0ce981a759f09660504ace2..2338477f4cdf7becf3ddbb8da3c28940360e9645 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -57,6 +56,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.Upd
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -616,10 +616,8 @@ public class SyncPlanPushStrategyIncrementalImplTest {
                 .thenReturn(RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture());
 
         final FlowCapableNode operational = new FlowCapableNodeBuilder()
-                .setTable(Collections.singletonList(new TableBuilder()
-                        .setId(Uint8.ONE)
-                        .build()))
-                .setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
+                .setTable(BindingMap.of(new TableBuilder().setId(Uint8.ONE).build()))
+                .setTableFeatures(BindingMap.of(new TableFeaturesBuilder()
                         .setName("test table features")
                         .setTableId(Uint8.ONE)
                         .build()))
index 5534f6967dbb6aa5ab38eeec1eb50551cfc68618..fe59607dc3c36a4acd8bb7db209ae16788da794d 100644 (file)
@@ -61,7 +61,8 @@ public class NodeConnectorInventoryEventTranslator<T extends DataObject>
             = new HashMap<>();
 
     @SuppressWarnings("IllegalCatch")
-    public NodeConnectorInventoryEventTranslator(DataBroker dataBroker, NodeConnectorEventsObserver... observers) {
+    public NodeConnectorInventoryEventTranslator(final DataBroker dataBroker,
+            final NodeConnectorEventsObserver... observers) {
         this.observers = ImmutableSet.copyOf(observers);
         final DataTreeIdentifier dtiToNodeConnector = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
                                                                                    II_TO_FLOW_CAPABLE_NODE_CONNECTOR);
@@ -93,7 +94,7 @@ public class NodeConnectorInventoryEventTranslator<T extends DataObject>
     }
 
     @Override
-    public void onDataTreeChanged(@NonNull Collection<DataTreeModification<T>> modifications) {
+    public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<T>> modifications) {
         for (DataTreeModification modification : modifications) {
             LOG.trace("Node connectors in inventory changed -> {}", modification.getRootNode().getModificationType());
             switch (modification.getRootNode().getModificationType()) {
@@ -142,7 +143,7 @@ public class NodeConnectorInventoryEventTranslator<T extends DataObject>
             FlowCapableNodeConnector flowNodeConnector = iiToDownFlowCapableNodeConnectors.get(nodeConnectorInstanceId);
             if (flowNodeConnector != null) {
                 State state = (State) modification.getRootNode().getDataAfter();
-                if (!state.isLinkDown()) {
+                if (!state.getLinkDown()) {
                     FlowCapableNodeConnectorBuilder flowCapableNodeConnectorBuilder
                             = new FlowCapableNodeConnectorBuilder(flowNodeConnector);
                     flowCapableNodeConnectorBuilder.setState(state);
@@ -162,14 +163,14 @@ public class NodeConnectorInventoryEventTranslator<T extends DataObject>
         }
     }
 
-    private boolean compareIITail(final InstanceIdentifier<?> ii1, final InstanceIdentifier<?> ii2) {
+    private static boolean compareIITail(final InstanceIdentifier<?> ii1, final InstanceIdentifier<?> ii2) {
         return Iterables.getLast(ii1.getPathArguments()).equals(Iterables.getLast(ii2.getPathArguments()));
     }
 
     private static boolean isPortDown(final FlowCapableNodeConnector flowCapableNodeConnector) {
         PortState portState = flowCapableNodeConnector.getState();
         PortConfig portConfig = flowCapableNodeConnector.getConfiguration();
-        return portState != null && portState.isLinkDown() || portConfig != null && portConfig.isPORTDOWN();
+        return portState != null && portState.getLinkDown() || portConfig != null && portConfig.getPORTDOWN();
     }
 
     private void notifyNodeConnectorAppeared(final InstanceIdentifier<NodeConnector> nodeConnectorInstanceId,
index b7e48cbcd29ad6105472367d58074c2302a72e02..92a47543674a485cc178842a940fd2ea1b93d6eb 100644 (file)
@@ -161,7 +161,7 @@ public class NodeConnectorInventoryEventTranslatorTest {
         // Create prerequisites
         InstanceIdentifier<NodeConnector> id2 = TestUtils.createNodeConnectorId("openflow:1", "openflow:1:2");
         InstanceIdentifier<FlowCapableNodeConnector> iiToConnector2 = id2.augmentation(FlowCapableNodeConnector.class);
-        List<DataTreeModification> modifications = new ArrayList();
+        List<DataTreeModification> modifications = new ArrayList<>();
         modifications.add(setupDataTreeChange(WRITE, NODE_CONNECTOR_INSTANCE_IDENTIFIER, FLOW_CAPABLE_NODE_CONNECTOR));
         modifications.add(setupDataTreeChange(DELETE, iiToConnector2, null));
         // Invoke onDataTreeChanged and check that both observers notified
index c2839277ebb5c544a02a68c637b54c0ec463cb51..f7f7e7b19a3d9d79c09f719959830084ac1f3ed4 100644 (file)
@@ -69,9 +69,10 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
     private final AlarmAgent alarmAgent;
     private final NodeListener nodeListener;
     private final int threadPoolSize = 10;
-    private final ExecutorService executor = Executors.newWorkStealingPool(threadPoolSize);
     private final Map<String, ReconciliationState> reconciliationStates;
 
+    private ExecutorService executor = Executors.newWorkStealingPool(threadPoolSize);
+
     public ReconciliationServiceImpl(final DataBroker broker, final FrmReconciliationService frmReconciliationService,
                                      final AlarmAgent alarmAgent, final NodeListener nodeListener,
                                      final FlowGroupCacheManager flowGroupCacheManager) {
@@ -86,12 +87,13 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
     public void close() {
         if (executor != null) {
             executor.shutdownNow();
+            executor = null;
         }
     }
 
     @Override
-    public ListenableFuture<RpcResult<ReconcileOutput>> reconcile(ReconcileInput input) {
-        boolean reconcileAllNodes = input.isReconcileAllNodes();
+    public ListenableFuture<RpcResult<ReconcileOutput>> reconcile(final ReconcileInput input) {
+        boolean reconcileAllNodes = input.getReconcileAllNodes();
         List<Uint64> inputNodes = input.getNodes();
         if (inputNodes == null) {
             inputNodes = new ArrayList<>();
@@ -142,7 +144,7 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
         return reconciliationStates.get(nodeId.toString());
     }
 
-    private static ListenableFuture<RpcResult<ReconcileOutput>> buildErrorResponse(String msg) {
+    private static ListenableFuture<RpcResult<ReconcileOutput>> buildErrorResponse(final String msg) {
         LOG.error("Error {}", msg);
         return RpcResultBuilder.<ReconcileOutput>failed()
                 .withError(RpcError.ErrorType.PROTOCOL, "reconcile", msg)
@@ -151,7 +153,7 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
 
     private List<Long> getAllNodes() {
         List<OFNode> nodeList = ShellUtil.getAllNodes(nodeListener);
-        List<Long> nodes = nodeList.stream().distinct().map(node -> node.getNodeId()).collect(Collectors.toList());
+        List<Long> nodes = nodeList.stream().distinct().map(OFNode::getNodeId).collect(Collectors.toList());
         return nodes;
     }
 
@@ -160,7 +162,7 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
         private final NodeKey nodeKey;
         private final Uint64 nodeId;
 
-        private ReconciliationTask(Uint64 nodeId, NodeKey nodeKey) {
+        private ReconciliationTask(final Uint64 nodeId, final NodeKey nodeKey) {
             this.nodeId = nodeId;
             this.nodeKey = nodeKey;
         }
@@ -230,8 +232,8 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
             }
         }
 
-        private Optional<ReconcileCounter> getReconciliationCount(ReadWriteTransaction tx,
-                                                             InstanceIdentifier<ReconcileCounter> instanceIdentifier) {
+        private Optional<ReconcileCounter> getReconciliationCount(final ReadWriteTransaction tx,
+                final InstanceIdentifier<ReconcileCounter> instanceIdentifier) {
             try {
                 return tx.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier).get();
             } catch (InterruptedException | ExecutionException e) {
@@ -240,8 +242,7 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
             return Optional.empty();
         }
 
-
-        private void updateReconciliationState(ReconciliationState.ReconciliationStatus status) {
+        private void updateReconciliationState(final ReconciliationState.ReconciliationStatus status) {
             ReconciliationState state = new ReconciliationState(status, LocalDateTime.now());
             reconciliationStates.put(nodeId.toString(),state);
         }
index da4bb99b0ae81180735c2d35bd035283794efcfc..d75ced1e69bb35ab93476ede8e14b8b50d6a6f98 100644 (file)
@@ -32,6 +32,7 @@ public class ShowNodeCommandProvider extends OsgiCommandSupport {
     }
 
     @SuppressWarnings("checkstyle:RegexpSinglelineJava")
+    @Deprecated
     @Override
     protected Object doExecute() {
         if (nodeId == null) {
index 43ac954e3d22b69358fb47dd359aea40f38a1b24..16e52aa31a188f21971598d1d5039dc6ec4cd80b 100644 (file)
@@ -47,7 +47,7 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
     }
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<FlowCapableNodeConnector>> modifications) {
+    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNodeConnector>> modifications) {
         for (DataTreeModification<FlowCapableNodeConnector> modification : modifications) {
             switch (modification.getRootNode().getModificationType()) {
                 case WRITE:
@@ -127,9 +127,9 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
 
     private void removeLinks(final FlowCapableNodeConnector flowCapNodeConnector, final TerminationPoint point) {
         operationProcessor.enqueueOperation(manager -> {
-            if (flowCapNodeConnector.getState() != null && flowCapNodeConnector.getState().isLinkDown()
+            if (flowCapNodeConnector.getState() != null && flowCapNodeConnector.getState().getLinkDown()
                     || flowCapNodeConnector.getConfiguration() != null
-                        && flowCapNodeConnector.getConfiguration().isPORTDOWN()) {
+                        && flowCapNodeConnector.getConfiguration().getPORTDOWN()) {
                 TopologyManagerUtil.removeAffectedLinks(point.getTpId(), manager, II_TO_TOPOLOGY);
             }
         });
index 8a98549a725da93893e402721f3667f66354ecc2..b6e645ff9ebc7191faf5638066e4b49792af5593 100644 (file)
@@ -26,7 +26,7 @@ public abstract class AbstractMatchCodec implements
     protected EricHeader headerWithMask;
     protected EricHeader headerWithoutMask;
 
-    protected MatchEntryBuilder deserializeHeaderToBuilder(ByteBuf message) {
+    protected MatchEntryBuilder deserializeHeaderToBuilder(final ByteBuf message) {
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(getOxmClass());
         // skip oxm_class - provided
@@ -40,20 +40,20 @@ public abstract class AbstractMatchCodec implements
     }
 
     @Override
-    public MatchEntry deserializeHeader(ByteBuf message) {
+    public MatchEntry deserializeHeader(final ByteBuf message) {
         return deserializeHeaderToBuilder(message).build();
     }
 
     @Override
-    public void serializeHeader(MatchEntry input, ByteBuf outBuffer) {
-        serializeHeader(getHeader(input.isHasMask()), outBuffer);
+    public void serializeHeader(final MatchEntry input, final ByteBuf outBuffer) {
+        serializeHeader(getHeader(input.getHasMask()), outBuffer);
     }
 
-    public void serializeHeader(EricHeader input, ByteBuf outBuffer) {
+    public void serializeHeader(final EricHeader input, final ByteBuf outBuffer) {
         outBuffer.writeInt((int) input.toLong());
     }
 
-    protected EricHeader getHeader(boolean hasMask) {
+    protected EricHeader getHeader(final boolean hasMask) {
         if (hasMask) {
             if (headerWithMask == null) {
                 headerWithMask = buildHeader(hasMask);
@@ -67,7 +67,7 @@ public abstract class AbstractMatchCodec implements
         }
     }
 
-    protected EricHeader buildHeader(boolean hasMask) {
+    protected EricHeader buildHeader(final boolean hasMask) {
         return new EricHeader(
                 getOxmClassCode(),
                 getEricFieldCode(),
index 7eb82bf8bbb4c91fe0f56c9794bd1eb3be708adc..4f137b6f4de1ca2b3326526909b764d4d4336aa6 100644 (file)
@@ -11,7 +11,6 @@ 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.eric.api.EricConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EricExpClass;
@@ -28,15 +27,10 @@ public class Icmpv6NDOptionsTypeCodecTest {
     private static final int ERIC_FIELD_CODE = 2;
     private static final int VALUE_LENGTH = 1;
 
-    private Icmpv6NDOptionsTypeCodec icmpv6NDOptionsTypeCodec;
-    private ByteBuf buffer;
-    private MatchEntry input;
+    private final Icmpv6NDOptionsTypeCodec icmpv6NDOptionsTypeCodec = new Icmpv6NDOptionsTypeCodec();
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
 
-    @Before
-    public void setUp() {
-        icmpv6NDOptionsTypeCodec = new Icmpv6NDOptionsTypeCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
+    private MatchEntry input;
 
     @Test
     public void serializeTest() {
@@ -61,7 +55,7 @@ public class Icmpv6NDOptionsTypeCodecTest {
         final Icmpv6NdOptionsTypeCaseValue result = (Icmpv6NdOptionsTypeCaseValue) input.getMatchEntryValue();
         assertEquals(EricExpClass.class, input.getOxmClass());
         assertEquals(Icmpv6NdOptionsType.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIcmpv6NdOptionsTypeValues().getIcmpv6NdOptionsType().shortValue());
     }
 
@@ -81,7 +75,7 @@ public class Icmpv6NDOptionsTypeCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(EricConstants.ERICOXM_OF_EXPERIMENTER_ID);
 
         int fieldMask = ERIC_FIELD_CODE << 1;
index 5138344400e237af934b15afe03bba57f65a5ab1..5db34ae34b70d3e6f0142fae133aa37d195d7063 100644 (file)
@@ -11,7 +11,6 @@ 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.eric.api.EricConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EricExpClass;
@@ -28,15 +27,10 @@ public class Icmpv6NDReservedCodecTest {
     private static final int ERIC_FIELD_CODE = 1;
     private static final int VALUE_LENGTH = 4;
 
-    private Icmpv6NDReservedCodec icmpv6NDReservedCodec;
-    private ByteBuf buffer;
-    private MatchEntry input;
+    private final Icmpv6NDReservedCodec icmpv6NDReservedCodec = new Icmpv6NDReservedCodec();
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
 
-    @Before
-    public void setUp() {
-        icmpv6NDReservedCodec = new Icmpv6NDReservedCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
+    private MatchEntry input;
 
     @Test
     public void serializeTest() {
@@ -60,7 +54,7 @@ public class Icmpv6NDReservedCodecTest {
 
         assertEquals(EricExpClass.class, input.getOxmClass());
         assertEquals(Icmpv6NdReserved.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIcmpv6NdReservedValues().getIcmpv6NdReserved().intValue());
     }
 
@@ -79,7 +73,7 @@ public class Icmpv6NDReservedCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(EricConstants.ERICOXM_OF_EXPERIMENTER_ID);
         int fieldMask = ERIC_FIELD_CODE << 1;
         message.writeByte(fieldMask);
index 35e44e53e1ace80de45de8ce9eb5e055363a521a..eaa7da5a40ef285ffd7bd76d29919d90f6e6e36b 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec {
 
     protected static <F extends MatchField> MatchEntrySerializerKey<ExperimenterClass, F> createSerializerKey(
-            short version, Uint32 expId, Class<F> oxmField) {
+            final short version, final Uint32 expId, final Class<F> oxmField) {
         MatchEntrySerializerKey<ExperimenterClass, F> key = new MatchEntrySerializerKey<>(
                 version, ExperimenterClass.class, oxmField);
         key.setExperimenterId(expId);
@@ -37,7 +37,7 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
     }
 
     protected static MatchEntryDeserializerKey createDeserializerKey(
-            short version, Uint32 expId, int fieldCode) {
+            final short version, final Uint32 expId, final int fieldCode) {
         MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(
                 version, OxmMatchConstants.EXPERIMENTER_CLASS, fieldCode);
         key.setExperimenterId(expId);
@@ -45,7 +45,7 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
     }
 
     @Override
-    public void serialize(MatchEntry input, ByteBuf outBuffer) {
+    public void serialize(final MatchEntry input, final ByteBuf outBuffer) {
         // serializes standard header + experimenterId
         serializeHeader(input, outBuffer);
 
@@ -53,13 +53,13 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
         OfjAugNxExpMatch ofjAugNxExpMatch = experimenterIdCase.augmentation(OfjAugNxExpMatch.class);
         NxExpMatchEntryValue nxExpMatchEntryValue = ofjAugNxExpMatch.getNxExpMatchEntryValue();
 
-        serializeValue(nxExpMatchEntryValue, input.isHasMask(), outBuffer);
+        serializeValue(nxExpMatchEntryValue, input.getHasMask(), outBuffer);
     }
 
     protected abstract void serializeValue(NxExpMatchEntryValue value, boolean hasMask, ByteBuf outBuffer);
 
     @Override
-    public MatchEntry deserialize(ByteBuf message) {
+    public MatchEntry deserialize(final ByteBuf message) {
         final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
 
         // skip experimenter Id
@@ -70,16 +70,16 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
         expBuilder.setExperimenter(new ExperimenterId(getExperimenterId()));
         expCaseBuilder.setExperimenter(expBuilder.build());
 
-        final NxExpMatchEntryValue value = deserializeValue(message, matchEntryBuilder.isHasMask());
+        final NxExpMatchEntryValue value = deserializeValue(message, matchEntryBuilder.getHasMask());
 
         return buildMatchEntry(matchEntryBuilder, expCaseBuilder, value);
     }
 
     protected abstract NxExpMatchEntryValue deserializeValue(ByteBuf message, boolean hasMask);
 
-    private static MatchEntry buildMatchEntry(MatchEntryBuilder matchEntryBuilder,
-                                                ExperimenterIdCaseBuilder experimenterIdCaseBuilder,
-                                                NxExpMatchEntryValue nxExpMatchEntryValue) {
+    private static MatchEntry buildMatchEntry(final MatchEntryBuilder matchEntryBuilder,
+                                              final ExperimenterIdCaseBuilder experimenterIdCaseBuilder,
+                                              final NxExpMatchEntryValue nxExpMatchEntryValue) {
         return matchEntryBuilder
                 .setMatchEntryValue(experimenterIdCaseBuilder.addAugmentation(new OfjAugNxExpMatchBuilder()
                     .setNxExpMatchEntryValue(nxExpMatchEntryValue)
@@ -89,12 +89,12 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
     }
 
     @Override
-    public void serializeHeader(NxmHeader input, ByteBuf outBuffer) {
+    public void serializeHeader(final NxmHeader input, final ByteBuf outBuffer) {
         outBuffer.writeLong(input.toLong());
     }
 
     @Override
-    protected NxmHeader buildHeader(boolean hasMask) {
+    protected NxmHeader buildHeader(final boolean hasMask) {
         return new NxmHeader(
                 getNxmFieldCode(),
                 hasMask,
@@ -113,5 +113,4 @@ public abstract class AbstractExperimenterMatchCodec extends AbstractMatchCodec
     }
 
     protected abstract @NonNull Uint32 getExperimenterId();
-
 }
index 21cd1c0bf918da1defbdfb95eabdf50644e175d4..723fc4b48a7574d49811d42f2c32d1665642359c 100644 (file)
@@ -26,7 +26,7 @@ public abstract class AbstractMatchCodec implements
     protected NxmHeader headerWithMask;
     protected NxmHeader headerWithoutMask;
 
-    protected MatchEntryBuilder deserializeHeaderToBuilder(ByteBuf message) {
+    protected MatchEntryBuilder deserializeHeaderToBuilder(final ByteBuf message) {
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(getOxmClass());
         // skip oxm_class - provided
@@ -40,20 +40,20 @@ public abstract class AbstractMatchCodec implements
     }
 
     @Override
-    public MatchEntry deserializeHeader(ByteBuf message) {
+    public MatchEntry deserializeHeader(final ByteBuf message) {
         return deserializeHeaderToBuilder(message).build();
     }
 
     @Override
-    public void serializeHeader(MatchEntry input, ByteBuf outBuffer) {
-        serializeHeader(getHeader(input.isHasMask()), outBuffer);
+    public void serializeHeader(final MatchEntry input, final ByteBuf outBuffer) {
+        serializeHeader(getHeader(input.getHasMask()), outBuffer);
     }
 
-    public void serializeHeader(NxmHeader input, ByteBuf outBuffer) {
+    public void serializeHeader(final NxmHeader input, final ByteBuf outBuffer) {
         outBuffer.writeInt((int) input.toLong());
     }
 
-    protected NxmHeader getHeader(boolean hasMask) {
+    protected NxmHeader getHeader(final boolean hasMask) {
         if (hasMask) {
             if (headerWithMask == null) {
                 headerWithMask = buildHeader(hasMask);
@@ -67,7 +67,7 @@ public abstract class AbstractMatchCodec implements
         }
     }
 
-    protected NxmHeader buildHeader(boolean hasMask) {
+    protected NxmHeader buildHeader(final boolean hasMask) {
         return new NxmHeader(
                 getOxmClassCode(),
                 getNxmFieldCode(),
@@ -108,5 +108,4 @@ public abstract class AbstractMatchCodec implements
      * Returns the oxm_class class.
      */
     public abstract Class<? extends OxmClassBase> getOxmClass();
-
 }
index 062b3dab7922d0faa9c4a572b82f49d817cd7c71..90610e8594c9f0e2f98fc73883dac89842d75df2 100644 (file)
@@ -23,12 +23,12 @@ public abstract class AbstractRegCodec extends AbstractMatchCodec {
     private static final int VALUE_LENGTH = 4;
 
     @Override
-    public MatchEntry deserialize(ByteBuf message) {
+    public MatchEntry deserialize(final ByteBuf message) {
         final MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
         final RegValuesBuilder regValuesBuilder = new RegValuesBuilder();
         regValuesBuilder.setValue(readUint32(message));
 
-        if (matchEntriesBuilder.isHasMask()) {
+        if (matchEntriesBuilder.getHasMask()) {
             regValuesBuilder.setMask(readUint32(message));
         }
 
@@ -40,12 +40,12 @@ public abstract class AbstractRegCodec extends AbstractMatchCodec {
     }
 
     @Override
-    public void serialize(MatchEntry input, ByteBuf outBuffer) {
+    public void serialize(final MatchEntry input, final ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
         final RegCaseValue regCase = (RegCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(regCase.getRegValues().getValue().intValue());
 
-        if (input.isHasMask()) {
+        if (input.getHasMask()) {
             outBuffer.writeInt(regCase.getRegValues().getMask().intValue());
         }
     }
index b318f186d1bab2141158b7f2f0a6ddb260d94b5f..18aa86cc6a9a89130283765fb451a1d26dc5bfdf 100755 (executable)
@@ -26,20 +26,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 
 /**
  * Codec for CtMark.
- * s
+ *
  * @author Bertrand Low.
  */
 public class CtMarkCodec extends AbstractMatchCodec {
-
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 107;
+
     public static final MatchEntrySerializerKey<Nxm1Class, NxmNxCtMark> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
             EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.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) {
+    public void serialize(final MatchEntry input, final ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
         CtMarkCaseValue ctMarkCase = (CtMarkCaseValue) input.getMatchEntryValue();
         outBuffer.writeInt(ctMarkCase.getCtMarkValues().getCtMark().intValue());
@@ -47,11 +47,11 @@ public class CtMarkCodec extends AbstractMatchCodec {
     }
 
     @Override
-    public MatchEntry deserialize(ByteBuf message) {
+    public MatchEntry deserialize(final ByteBuf message) {
         final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
         CtMarkCaseValueBuilder caseBuilder = new CtMarkCaseValueBuilder();
         CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
-        if (matchEntryBuilder.isHasMask()) {
+        if (matchEntryBuilder.getHasMask()) {
             ctMarkValuesBuilder.setMask(readUint32(message));
         }
         ctMarkValuesBuilder.setCtMark(readUint32(message));
index c1eda2b10cb7d0ed285609f8af06113bf9cfa4b2..47719537723ed22c22bd1d0979d3b1a52e485409 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import static org.junit.Assert.assertEquals;
@@ -48,12 +47,13 @@ public class AbstractExperimenterMatchCodecTest {
     private class TestCodec extends AbstractExperimenterMatchCodec {
 
         @Override
-        protected void serializeValue(NxExpMatchEntryValue value, boolean hasMask, ByteBuf outBuffer) {
+        protected void serializeValue(final NxExpMatchEntryValue value, final boolean hasMask,
+                final ByteBuf outBuffer) {
             // noop
         }
 
         @Override
-        protected NxExpMatchEntryValue deserializeValue(ByteBuf outBuffer, boolean hasMask) {
+        protected NxExpMatchEntryValue deserializeValue(final ByteBuf outBuffer, final boolean hasMask) {
             return null;
         }
 
@@ -120,7 +120,7 @@ public class AbstractExperimenterMatchCodecTest {
 
         assertEquals(ExperimenterClass.class, matchEntry.getOxmClass());
         assertEquals(TestNxmField.class, matchEntry.getOxmMatchField());
-        assertEquals(false, matchEntry.isHasMask());
+        assertEquals(false, matchEntry.getHasMask());
         Experimenter experimenter = ((ExperimenterIdCase) matchEntry.getMatchEntryValue()).getExperimenter();
         assertEquals(EXPERIMENTER_ID, experimenter.getExperimenter().getValue());
         assertFalse(buffer.isReadable());
@@ -135,14 +135,14 @@ public class AbstractExperimenterMatchCodecTest {
 
         assertEquals(ExperimenterClass.class, matchEntry.getOxmClass());
         assertEquals(TestNxmField.class, matchEntry.getOxmMatchField());
-        assertEquals(true, matchEntry.isHasMask());
+        assertEquals(true, matchEntry.getHasMask());
         Experimenter experimenter = ((ExperimenterIdCase) matchEntry.getMatchEntryValue()).getExperimenter();
         assertEquals(EXPERIMENTER_ID, experimenter.getExperimenter().getValue());
         assertFalse(buffer.isReadable());
         verify(testCodec).deserializeValue(buffer, true);
     }
 
-    static MatchEntry createMatchEntry(NxExpMatchEntryValue value, boolean hasMask) {
+    static MatchEntry createMatchEntry(final NxExpMatchEntryValue value, final boolean hasMask) {
         return new MatchEntryBuilder()
                 .setOxmClass(ExperimenterClass.class)
                 .setOxmMatchField(TestNxmField.class)
@@ -156,7 +156,7 @@ public class AbstractExperimenterMatchCodecTest {
                 .build();
     }
 
-    static void writeBuffer(ByteBuf message, boolean hasMask) {
+    static void writeBuffer(final ByteBuf message, final boolean hasMask) {
         int fieldMask = FIELD_CODE << 1;
         int length = Integer.BYTES + VALUE_LENGTH;
         if (hasMask) {
index 5d55a7c13407f448fe9be6ea8b95896b1120561b..253351df379ab14301509aa1fd87e163ae684864 100644 (file)
@@ -62,7 +62,7 @@ public class ArpOpCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpOp.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getArpOpValues().getValue().shortValue());
     }
 
@@ -82,7 +82,7 @@ public class ArpOpCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 739fd1c321482855fa30b7e154f37ce3e96ac505..5aea6d9f148ee46e0c3301f3db6bc2da3aae91b4 100644 (file)
@@ -66,7 +66,7 @@ public class ArpShaCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxArpSha.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(RESULT_ADDRESS, result.getArpShaValues().getMacAddress());
     }
 
@@ -88,7 +88,7 @@ public class ArpShaCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 01718ffa22058ebfa74720aa2e24a2f628ad9e53..9b8e31ae871322872e0b4691d4165f9d53bc1b0b 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,21 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class ArpSpaCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final ArpSpaCodec arpSpaCodec = new ArpSpaCodec();
 
-    ArpSpaCodec arpSpaCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 16;
 
-
-    @Before
-    public void setUp() {
-        arpSpaCodec = new ArpSpaCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +53,7 @@ public class ArpSpaCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpSpa.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getArpSpaValues().getValue().shortValue());
     }
 
@@ -81,7 +73,7 @@ public class ArpSpaCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index b243fb8db67080ac5edeedc6f2fdc72bd1694ace..276bd43c90c72eac5becc32d10cad9f11c685344 100644 (file)
@@ -65,7 +65,7 @@ public class ArpThaCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxArpTha.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(TEST_ADDRESS, result.getArpThaValues().getMacAddress());
     }
 
@@ -85,7 +85,7 @@ public class ArpThaCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 3d69533a888f437b227211a91e936c5bf9d1baef..9d90b14df878dc1d57c8195c79747d292c980bb7 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class ArpTpaCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final ArpTpaCodec arpTpaCodec = new ArpTpaCodec();
 
-    ArpTpaCodec arpTpaCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 17;
 
-    @Before
-    public void setUp() {
-        arpTpaCodec = new ArpTpaCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -60,7 +53,7 @@ public class ArpTpaCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfArpTpa.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getArpTpaValues().getValue().intValue());
     }
 
@@ -80,7 +73,7 @@ public class ArpTpaCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 0f709f39b1a71274ea9130952659754977c3bda0..49d1c68e3bf382e0da68064736332e36ac377657 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class CtStateCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final CtStateCodec ctStateCodec = new CtStateCodec();
 
-    CtStateCodec ctStateCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 8;
     private static final int NXM_FIELD_CODE = 105;
 
-    @Before
-    public void setUp() {
-        ctStateCodec = new CtStateCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class CtStateCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtState.class, input.getOxmMatchField());
-        assertEquals(true, input.isHasMask());
+        assertEquals(true, input.getHasMask());
         assertEquals(1, result.getCtStateValues().getCtState().intValue());
         assertEquals(2, result.getCtStateValues().getMask().intValue());
     }
@@ -83,7 +76,7 @@ public class CtStateCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index a818edaf7453b3d477ccbc585e0acc96280a6694..8036100f5f73a31f928fba1ec3731216b4ed5704 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -25,19 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class CtTpDstCodecTest {
-    private CtTpDstCodec ctTpDstCodec;
-    private ByteBuf buffer;
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final CtTpDstCodec ctTpDstCodec = new CtTpDstCodec();
+
     private MatchEntry input;
 
     private static final int VALUE_LENGTH = 2;
     private static final int NXM_FIELD_CODE = 125;
 
-    @Before
-    public void setUp() {
-        ctTpDstCodec = new CtTpDstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -60,7 +53,7 @@ public class CtTpDstCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtTpDst.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getCtTpDstValues().getCtTpDst().shortValue());
     }
 
@@ -80,7 +73,7 @@ public class CtTpDstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 12bd711c087c3be981d889e131d73ae2414f34e2..bd4d859d92b8d5abf5c779426a3e60e3b81e2886 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.match;
 
 import static org.junit.Assert.assertEquals;
@@ -60,7 +59,7 @@ public class CtTpSrcCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtTpSrc.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getCtTpSrcValues().getCtTpSrc().shortValue());
     }
 
@@ -80,7 +79,7 @@ public class CtTpSrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 1f72f8c42afb588ca579122e06021a1f4c447a10..1d12a8ae28d385af8112fa9f4292254b8280ff35 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,22 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class CtZoneCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final CtZoneCodec ctZoneCodec = new CtZoneCodec();
 
-    CtZoneCodec ctZoneCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 2;
     private static final int NXM_FIELD_CODE = 106;
 
-
-
-    @Before
-    public void setUp() {
-        ctZoneCodec = new CtZoneCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -62,11 +53,10 @@ public class CtZoneCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxCtZone.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getCtZoneValues().getCtZone().shortValue());
     }
 
-
     private static MatchEntry createMatchEntry() {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
         final CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
@@ -83,7 +73,7 @@ public class CtZoneCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index b80f603ef10f425965e0cf4d0c4c04a2547fe4fa..cbe14449dff438253e0d11b3d282150a310461cb 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -26,10 +25,10 @@ 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.EthDstCaseValueBuilder;
 
 public class EthDstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final EthDstCodec ethDstCodec = new EthDstCodec();
 
-    EthDstCodec ethDstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 1;
@@ -37,12 +36,6 @@ public class EthDstCodecTest {
     private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
     private static final MacAddress TEST_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(TEST_ADDR);
 
-    @Before
-    public void setUp() {
-        ethDstCodec = new EthDstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -66,7 +59,7 @@ public class EthDstCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthDst.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
     }
 
@@ -86,7 +79,7 @@ public class EthDstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index fdd8ef4c094eeb0fa89b9be9a9616cd09eba89fe..2c5d14dec7836cd28cd68a57d301c7d9b2d375fb 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -27,10 +26,10 @@ 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.EthSrcCaseValueBuilder;
 
 public class EthSrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final EthSrcCodec ethSrcCodec = new EthSrcCodec();
 
-    EthSrcCodec ethSrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 6;
     private static final int NXM_FIELD_CODE = 2;
@@ -38,12 +37,6 @@ public class EthSrcCodecTest {
     private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
     private static final MacAddress TEST_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(TEST_ADDR);
 
-    @Before
-    public void setUp() {
-        ethSrcCodec = new EthSrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -67,7 +60,7 @@ public class EthSrcCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthSrc.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(TEST_ADDRESS, result.getEthSrcValues().getMacAddress());
     }
 
@@ -88,7 +81,7 @@ public class EthSrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index fe3083e237c080a0cda55f1aec67488adbbaa6b1..08f5dbec801fbe37439d02e7f8af40cf089f85af 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class EthTypeCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final EthTypeCodec ethTypeCodec = new EthTypeCodec();
 
-    EthTypeCodec ethTypeCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 2;
     private static final int NXM_FIELD_CODE = 3;
 
-    @Before
-    public void setUp() {
-        ethTypeCodec = new EthTypeCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class EthTypeCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfEthType.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getEthTypeValues().getValue().shortValue());
     }
 
@@ -81,7 +74,7 @@ public class EthTypeCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index fe94fef50ec128f31248badf8a08a410148c2226..02990cd7614f2166266b1b534bd40b09fa8e2945 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class IcmpTypeCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final IcmpTypeCodec icmpTypeCodec = new IcmpTypeCodec();
 
-    IcmpTypeCodec icmpTypeCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 1;
     private static final int NXM_FIELD_CODE = 13;
 
-    @Before
-    public void setUp() {
-        icmpTypeCodec = new IcmpTypeCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class IcmpTypeCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIcmpType.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIcmpTypeValues().getValue().shortValue());
     }
 
@@ -81,7 +74,7 @@ public class IcmpTypeCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index a6f7a688bddcba594d5ff65e86a21f0e3c92d3ba..d185c82f4328fdd1929ad98319e982625454daca 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class IpDstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final IpDstCodec ipDstCodec = new IpDstCodec();
 
-    IpDstCodec ipDstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 8;
 
-    @Before
-    public void setUp() {
-        ipDstCodec = new IpDstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class IpDstCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIpDstValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class IpDstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 3ebebf7e2685ae51393aa38e54d6206e19bcadaf..617fc417bea218980d74666ec807073e90b37742 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class IpSrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final IpSrcCodec ipSrcCodec = new IpSrcCodec();
 
-    IpSrcCodec ipSrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 7;
 
-    @Before
-    public void setUp() {
-        ipSrcCodec = new IpSrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class IpSrcCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIpSrcValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class IpSrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 54b470c415bc36bd8c464ce6cab1b81071d2a820..6f25fd9f0d8ae4cd606483da49028dd27a0eeaf5 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Ipv6DstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Ipv6DstCodec ipv6DstCodec = new Ipv6DstCodec();
 
-    Ipv6DstCodec ipv6DstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 16;
     private static final int NXM_FIELD_CODE = 20;
 
-    @Before
-    public void setUp() {
-        ipv6DstCodec = new Ipv6DstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Ipv6DstCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIpDstValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Ipv6DstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index b8a18f35a5b93d7af241e2cffb59e0203db21315..c6b7bb06e24a779b5008b49596ebe03cccbc3a2b 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Ipv6SrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Ipv6SrcCodec ipv6SrcCodec = new Ipv6SrcCodec();
 
-    Ipv6SrcCodec ipv6SrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 16;
     private static final int NXM_FIELD_CODE = 19;
 
-    @Before
-    public void setUp() {
-        ipv6SrcCodec = new Ipv6SrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Ipv6SrcCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getIpSrcValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Ipv6SrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index d562c14bab6f6e2905b3ec8b257783c159a78049..51f4e2abd106374112029d5f9bac3544958c46b2 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -22,20 +21,14 @@ 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.OfMetadataCaseValueBuilder;
 
 public class MetadataCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final MetadataCodec metadataCodec = new MetadataCodec();
 
-    MetadataCodec metadataCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 2;
     private static final int VALUE_LENGTH = 8;
 
-    @Before
-    public void setUp() {
-        metadataCodec = new MetadataCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -54,7 +47,7 @@ public class MetadataCodecTest {
         input = metadataCodec.deserialize(buffer);
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfMetadata.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
     }
 
     private static MatchEntry createMatchEntry() {
@@ -71,7 +64,7 @@ public class MetadataCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
         int fieldMask = NXM_FIELD_CODE << 1;
         message.writeByte(fieldMask);
index 828fca8ea0a735ef0848ebbb198d6c55321c8ddb..00f8dcfd12ae05b04e25af4b181447219f20d3b2 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,18 +23,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class PktMarkCodecTest {
-
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 33;
-    private PktMarkCodec pktMarkCodec;
-    private ByteBuf buffer;
-    private MatchEntry input;
 
-    @Before
-    public void setUp() {
-        pktMarkCodec = new PktMarkCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final PktMarkCodec pktMarkCodec = new PktMarkCodec();
+    private MatchEntry input;
 
     @Test
     public void serializeTest() {
@@ -59,7 +52,7 @@ public class PktMarkCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxPktMark.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(2, result.getPktMarkValues().getPktMark().intValue());
     }
 
@@ -79,7 +72,7 @@ public class PktMarkCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 0304e723eba36624e3a213f81384e3d05d1c3f20..20d6bbb5e5238eb961e5ce0f43de14382284a64d 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg0CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg0Codec reg0Codec = new Reg0Codec();
 
-    Reg0Codec reg0Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 0;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg0Codec = new Reg0Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Reg0CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg0.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Reg0CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 386df9eb9718ff14569fd68a2776366834e7e2f3..94c363daa428b4e033df29f8a58d2db36b75e041 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg1CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg1Codec reg1Codec = new Reg1Codec();
 
-    Reg1Codec reg1Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 1;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg1Codec = new Reg1Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Reg1CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg1.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Reg1CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 280799fa3bd646e21a72e8f33cb3462ee7fbf931..bc51caccfa4414225f920d5738ca5dc38e0b2d29 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,19 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg2CodecTest {
-    Reg2Codec reg2Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg2Codec reg2Codec = new Reg2Codec();
+
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 2;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg2Codec = new Reg2Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -60,7 +54,7 @@ public class Reg2CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg2.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -80,7 +74,7 @@ public class Reg2CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 4871909ae7c8000e8b35490b222857fc01742f91..34ed88ef5fcc824bf6263149becd7ea00e7034af 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,21 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg3CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg3Codec reg3Codec = new Reg3Codec();
 
-    Reg3Codec reg3Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 3;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg3Codec = new Reg3Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -62,7 +54,7 @@ public class Reg3CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg3.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -82,7 +74,7 @@ public class Reg3CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index e8731431a9ba82c0a89a2e8732966cbfe85df552..53a675096d3801cdc7a2b5aaa045ea17786b3cde 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg4CodecTest {
-    Reg4Codec reg4Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg4Codec reg4Codec = new Reg4Codec();
+
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 4;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg4Codec = new Reg4Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Reg4CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg4.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Reg4CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 75741c90895d465e1eef2e04857f6fb628bf1fd6..245b1d0537602cbb42844068ff030781e1556958 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,21 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg5CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg5Codec reg5Codec = new Reg5Codec();
 
-    Reg5Codec reg5Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 5;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg5Codec = new Reg5Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -62,7 +54,7 @@ public class Reg5CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg5.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -82,7 +74,7 @@ public class Reg5CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index f304636387edc265eef97bdc4368000ca6eeb5e6..2178d2695b16f0a4f28f602b16284d848388b9a0 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg6CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg6Codec reg6Codec = new Reg6Codec();
 
-    Reg6Codec reg6Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 6;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg6Codec = new Reg6Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Reg6CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg6.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Reg6CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 70620f5b2bb30fbd44177b79898fbe817253a570..549cdb172a35f049870755220b427ecbe043712e 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Reg7CodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final Reg7Codec reg7Codec = new Reg7Codec();
 
-    Reg7Codec reg7Codec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int NXM_FIELD_CODE = 7;
     private static final int VALUE_LENGTH = 4;
 
-    @Before
-    public void setUp() {
-        reg7Codec = new Reg7Codec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class Reg7CodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxReg7.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getRegValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class Reg7CodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index ed2711467441e06457ed09f8a2161ca6e1906d3d..e7b7b1c08ff5a52fa712a51b94d92b95e998fc4b 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
@@ -25,20 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class TcpDstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final TcpDstCodec tcpDstCodec = new TcpDstCodec();
 
-    TcpDstCodec tcpDstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 10;
 
-    @Before
-    public void setUp() {
-        tcpDstCodec = new TcpDstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -63,7 +56,7 @@ public class TcpDstCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfTcpDst.class, input.getOxmMatchField());
-        assertEquals(true, input.isHasMask());
+        assertEquals(true, input.getHasMask());
         assertEquals(1, result.getTcpDstValues().getPort().getValue().shortValue());
         assertEquals(0xffff, result.getTcpDstValues().getMask().shortValue() & 0xffff);
     }
@@ -85,7 +78,7 @@ public class TcpDstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index a5218e1407501051f709d7b5a019137771a08116..9e727351fd11c2f6db9ca9e2cafb90fe8cb82fb8 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
@@ -25,20 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class TcpSrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final TcpSrcCodec tcpSrcCodec = new TcpSrcCodec();
 
-    TcpSrcCodec tcpSrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 9;
 
-    @Before
-    public void setUp() {
-        tcpSrcCodec = new TcpSrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -63,7 +56,7 @@ public class TcpSrcCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfTcpSrc.class, input.getOxmMatchField());
-        assertEquals(true, input.isHasMask());
+        assertEquals(true, input.getHasMask());
         assertEquals(1, result.getTcpSrcValues().getPort().getValue().shortValue());
         assertEquals(0xffff, result.getTcpSrcValues().getMask().shortValue() & 0xffff);
     }
@@ -85,7 +78,7 @@ public class TcpSrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 8653fd6eb8fac981a1f599113e7c897a249fb0b8..ad3694b820da29af8cad305adb698cd891c96d25 100644 (file)
@@ -12,7 +12,6 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufAllocator;
 import java.math.BigInteger;
-import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -25,20 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class TunIdCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final TunIdCodec tunIdCodec = new TunIdCodec();
 
-    TunIdCodec tunIdCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 8;
     private static final int NXM_FIELD_CODE = 16;
 
-    @Before
-    public void setUp() {
-        tunIdCodec = new TunIdCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -62,7 +55,7 @@ public class TunIdCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunId.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(0, result.getTunIdValues().getValue().longValue());
     }
 
@@ -82,7 +75,7 @@ public class TunIdCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 66bca890d515e46ea56faa57033db3f0e252cab6..6e72c1e6ada6ed60ad3a8e443be190d0ad2548a0 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class TunIpv4DstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final TunIpv4DstCodec tunIpv4DstCodec = new TunIpv4DstCodec();
 
-    TunIpv4DstCodec tunIpv4DstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 32;
 
-    @Before
-    public void setUp() {
-        tunIpv4DstCodec = new TunIpv4DstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class TunIpv4DstCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunIpv4Dst.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getTunIpv4DstValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class TunIpv4DstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 6fcb1fbc99204ec8c8b2f935a15c8deea3e73056..fec87dba38c50205fe7b6d5b6f7a15c328f89ea1 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
@@ -24,20 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class TunIpv4SrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final TunIpv4SrcCodec tunIpv4SrcCodec = new TunIpv4SrcCodec();
 
-    TunIpv4SrcCodec tunIpv4SrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 31;
 
-    @Before
-    public void setUp() {
-        tunIpv4SrcCodec = new TunIpv4SrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -61,7 +54,7 @@ public class TunIpv4SrcCodecTest {
 
         assertEquals(Nxm1Class.class, input.getOxmClass());
         assertEquals(NxmNxTunIpv4Src.class, input.getOxmMatchField());
-        assertEquals(false, input.isHasMask());
+        assertEquals(false, input.getHasMask());
         assertEquals(1, result.getTunIpv4SrcValues().getValue().intValue());
     }
 
@@ -81,7 +74,7 @@ public class TunIpv4SrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_1_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index d296a52230a4dedc36b546eded96fc0493e3cc17..780625cb6c7ed7d7bbf2465520754c26516cd1a2 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
@@ -25,20 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class UdpDstCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final UdpDstCodec udpDstCodec = new UdpDstCodec();
 
-    UdpDstCodec udpDstCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 12;
 
-    @Before
-    public void setUp() {
-        udpDstCodec = new UdpDstCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -63,7 +56,7 @@ public class UdpDstCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfUdpDst.class, input.getOxmMatchField());
-        assertEquals(true, input.isHasMask());
+        assertEquals(true, input.getHasMask());
         assertEquals(1, result.getUdpDstValues().getPort().getValue().shortValue());
         assertEquals(0xffff, result.getUdpDstValues().getMask().shortValue() & 0xffff);
     }
@@ -85,7 +78,7 @@ public class UdpDstCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 37f438c897166ab8a01ea75b8038b17081142167..8dfdc5cbd31082204c860b15b7a7eea335127e51 100644 (file)
@@ -11,7 +11,6 @@ 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.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
@@ -25,20 +24,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class UdpSrcCodecTest {
+    private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+    private final UdpSrcCodec udpSrcCodec = new UdpSrcCodec();
 
-    UdpSrcCodec udpSrcCodec;
-    ByteBuf buffer;
-    MatchEntry input;
+    private MatchEntry input;
 
     private static final int VALUE_LENGTH = 4;
     private static final int NXM_FIELD_CODE = 11;
 
-    @Before
-    public void setUp() {
-        udpSrcCodec = new UdpSrcCodec();
-        buffer = ByteBufAllocator.DEFAULT.buffer();
-    }
-
     @Test
     public void serializeTest() {
         input = createMatchEntry();
@@ -63,7 +56,7 @@ public class UdpSrcCodecTest {
 
         assertEquals(Nxm0Class.class, input.getOxmClass());
         assertEquals(NxmOfUdpSrc.class, input.getOxmMatchField());
-        assertEquals(true, input.isHasMask());
+        assertEquals(true, input.getHasMask());
         assertEquals(1, result.getUdpSrcValues().getPort().getValue().shortValue());
         assertEquals(0xffff, result.getUdpSrcValues().getMask().shortValue() & 0xffff);
     }
@@ -85,7 +78,7 @@ public class UdpSrcCodecTest {
         return matchEntryBuilder.build();
     }
 
-    private static void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(OxmMatchConstants.NXM_0_CLASS);
 
         int fieldMask = NXM_FIELD_CODE << 1;
index 07e19202b747af63fe01a3f457c65b2a23ba6ca3..7aaf2abe850222d91319774399f7d0651da5fc18 100644 (file)
@@ -58,7 +58,7 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
 
     @SuppressWarnings("unchecked")
     @Override
-    public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
+    public ExtensionAugment<? extends Augmentation<Extension>> convert(final MatchEntry input, final MatchPath path) {
         NxmNxRegBuilder nxRegBuilder = new NxmNxRegBuilder();
         if (!org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class
                 .isAssignableFrom(input.getOxmMatchField())) {
@@ -73,7 +73,7 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
         RegCaseValue regCaseValue = (RegCaseValue) input.getMatchEntryValue();
         nxRegBuilder.setValue(regCaseValue.getRegValues().getValue());
 
-        if (input.isHasMask()) {
+        if (input.getHasMask()) {
             nxRegBuilder.setMask(regCaseValue.getRegValues().getMask());
         }
 
@@ -81,7 +81,7 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
     }
 
     @Override
-    public MatchEntry convert(Extension extension) {
+    public MatchEntry convert(final Extension extension) {
         Optional<NxmNxRegGrouping> matchGrouping = MatchUtil.REG_RESOLVER.findExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
@@ -100,7 +100,7 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
             .build();
     }
 
-    private static Class<? extends ExtensionKey> resolveRegKey(Class<? extends MatchField> oxmMatchField) {
+    private static Class<? extends ExtensionKey> resolveRegKey(final Class<? extends MatchField> oxmMatchField) {
         if (NiciraMatchCodecs.REG0_CODEC.getNxmField().isAssignableFrom(oxmMatchField)) {
             return NxmNxReg0Key.class;
         }
@@ -128,8 +128,8 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
         throw new CodecPreconditionException("There is no key for " + oxmMatchField);
     }
 
-    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxReg nxmNxReg,
-            MatchPath path, Class<? extends ExtensionKey> key) {
+    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(final NxmNxReg nxmNxReg,
+            final MatchPath path, final Class<? extends ExtensionKey> key) {
         switch (path) {
             case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
index 3f3243b75b7d63956032a638a16dafdbc9838cee..cacbf6571db42304d385120cd681597c280eef89 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.extension.onf.serializer;
 
 import io.netty.buffer.ByteBuf;
@@ -34,12 +33,12 @@ public abstract class AbstractBundleMessageFactory<T extends DataContainer> impl
     protected SerializerRegistry serializerRegistry;
 
     @Override
-    public void injectSerializerRegistry(SerializerRegistry registry) {
+    public void injectSerializerRegistry(final SerializerRegistry registry) {
         this.serializerRegistry = registry;
     }
 
     static void writeBundleFlags(final BundleFlags bundleFlags, final ByteBuf outBuffer) {
-        short flagsBitMap = fillBitMask(bundleFlags.isAtomic(), bundleFlags.isOrdered());
+        short flagsBitMap = fillBitMask(bundleFlags.getAtomic(), bundleFlags.getOrdered());
         outBuffer.writeShort(flagsBitMap);
     }
 
index 6b187bda11d48a2e877c6966c7fa449ee9463636..05627b9842d1c13f8f7d90a31030e74ce997ce43 100644 (file)
@@ -169,7 +169,7 @@ public class BundleAddMessageConverterTest {
         testConvert(message, BundleFlowModCase.class, withProperty);
     }
 
-    private void testConvert(final BundleInnerMessage message, Class<? extends DataObject> clazz,
+    private void testConvert(final BundleInnerMessage message, final Class<? extends DataObject> clazz,
             final boolean withProperty) throws ConversionException {
         final BundleAddMessageSal original = createMessage(withProperty, message);
         final ExtensionConvertorData data = new ExtensionConvertorData(OFConstants.OFP_VERSION_1_3);
@@ -178,8 +178,8 @@ public class BundleAddMessageConverterTest {
         Assert.assertEquals("Wrong BundleId", new BundleId(original.getSalAddMessageData().getBundleId().getValue()),
                 converted.getOnfAddMessageGroupingData().getBundleId());
         Assert.assertEquals("Wrong flags",
-                new BundleFlags(original.getSalAddMessageData().getFlags().isAtomic(),
-                        original.getSalAddMessageData().getFlags().isOrdered()),
+                new BundleFlags(original.getSalAddMessageData().getFlags().getAtomic(),
+                        original.getSalAddMessageData().getFlags().getOrdered()),
                 converted.getOnfAddMessageGroupingData().getFlags());
         Assert.assertEquals("Wrong inner message conversion", clazz,
                 converted.getOnfAddMessageGroupingData().getBundleInnerMessage().implementedInterface());
index 7f3b760d7624b85540c7aed2411e2c40dc4f5488..43905e1c01bb62a5049c8bbe97b7c59046a1509e 100644 (file)
@@ -100,8 +100,8 @@ public class BundleControlConverterTest {
         );
         Assert.assertEquals("Wrong flags",
                 new BundleFlags(
-                        ofpMessage.getSalControlData().getFlags().isAtomic(),
-                        ofpMessage.getSalControlData().getFlags().isOrdered()),
+                        ofpMessage.getSalControlData().getFlags().getAtomic(),
+                        ofpMessage.getSalControlData().getFlags().getOrdered()),
                         ofjMessage.getOnfControlGroupingData().getFlags()
         );
         if (withProperty) {
index 4b83b238e7c115f4d37f4a36e47f4eeee8e843de..3061d9280c91b7fe5f1a2fe0888d56d379c9cdd6 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.extension.onf.deserializer;
 
 import static org.mockito.ArgumentMatchers.any;
@@ -51,9 +50,9 @@ public class BundleControlFactoryTest {
         Assert.assertEquals(1, builtByFactory.getOnfControlGroupingData().getBundleId().getValue().intValue());
         BundleFlags flags = new BundleFlags(true, true);
         Assert.assertEquals("Wrong atomic flag",
-                flags.isAtomic(), builtByFactory.getOnfControlGroupingData().getFlags().isAtomic());
+                flags.getAtomic(), builtByFactory.getOnfControlGroupingData().getFlags().getAtomic());
         Assert.assertEquals("Wrong ordered flag",
-                flags.isOrdered(), builtByFactory.getOnfControlGroupingData().getFlags().isOrdered());
+                flags.getOrdered(), builtByFactory.getOnfControlGroupingData().getFlags().getOrdered());
         Assert.assertEquals("Wrong type",
                 BundleControlType.ONFBCTOPENREPLY, builtByFactory.getOnfControlGroupingData().getType());
         Assert.assertTrue("Properties not empty",
@@ -80,10 +79,10 @@ public class BundleControlFactoryTest {
         Assert.assertEquals(1, builtByFactory.getOnfControlGroupingData().getBundleId().getValue().intValue());
         BundleFlags flags = new BundleFlags(false, true);
         Assert.assertEquals("Wrong atomic flag",
-                flags.isAtomic(), builtByFactory.getOnfControlGroupingData().getFlags().isAtomic());
+                flags.getAtomic(), builtByFactory.getOnfControlGroupingData().getFlags().getAtomic());
         Assert.assertEquals("Wrong ordered flag",
-                flags.isOrdered(),
-                builtByFactory.getOnfControlGroupingData().getFlags().isOrdered());
+                flags.getOrdered(),
+                builtByFactory.getOnfControlGroupingData().getFlags().getOrdered());
         Assert.assertEquals("Wrong type",
                 BundleControlType.ONFBCTCOMMITREPLY, builtByFactory.getOnfControlGroupingData().getType());
         BundleProperty property = builtByFactory.getOnfControlGroupingData().getBundleProperty().get(0);
index 255771a822ced67f3f0ee3a21094391b39e8e7b6..19277ed3b69780e5183454f400fb6d26f3be55e2 100644 (file)
@@ -9,8 +9,7 @@ package org.opendaylight.openflowplugin.test;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Map;
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
 import org.opendaylight.mdsal.binding.api.DataBroker;
@@ -38,9 +37,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.in._case.CopyTtlInBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.out._case.CopyTtlOutBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.mpls.ttl._case.DecMplsTtlBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder;
@@ -67,14 +64,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
@@ -84,7 +78,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
@@ -96,6 +89,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
@@ -104,7 +98,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class);
     private final DataBroker dataBroker;
@@ -115,8 +108,8 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
     private final String originalGroupName = "Foo";
     private final NotificationService notificationService;
 
-    public OpenflowPluginBulkGroupTransactionProvider(DataBroker dataBroker, NotificationService notificationService,
-            BundleContext ctx) {
+    public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker,
+            final NotificationService notificationService, final BundleContext ctx) {
         this.dataBroker = dataBroker;
         this.notificationService = notificationService;
         this.ctx = ctx;
@@ -132,17 +125,11 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         if (nodeId == null) {
             nodeId = OpenflowpluginTestActivator.NODE_ID;
         }
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(nodeId));
-        builder.withKey(new NodeKey(builder.getId()));
-        return builder;
+        return new NodeBuilder().setId(new NodeId(nodeId));
     }
 
     private void createTestNode() {
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
-        builder.withKey(new NodeKey(builder.getId()));
-        testNode12 = builder.build();
+        testNode12 = new NodeBuilder().setId(new NodeId(OpenflowpluginTestActivator.NODE_ID)).build();
     }
 
     @Override
@@ -167,272 +154,166 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
     }
 
     private static InstructionsBuilder createDecNwTtlInstructions() {
-        DecNwTtlBuilder ta = new DecNwTtlBuilder();
-        DecNwTtl decNwTtl = ta.build();
-        ActionBuilder ab = new ActionBuilder();
-        ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
-
-        // Add our drop action to a list
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-        ib.withKey(new InstructionKey(0));
-        ib.setOrder(0);
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new DecNwTtlCaseBuilder().setDecNwTtl(new DecNwTtlBuilder().build()).build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static MatchBuilder createMatch2() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
-        ipv4Match.setIpv4Source(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x0800)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
+        return new MatchBuilder()
+            .setLayer3Match(new Ipv4MatchBuilder().setIpv4Source(new Ipv4Prefix("10.0.0.1")).build())
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .build());
     }
 
     private static MatchBuilder createMatch3() {
-        MatchBuilder match = new MatchBuilder();
-        EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
-        EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
-        ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
-        ethernetMatch.setEthernetSource(ethSourceBuilder.build());
-        match.setEthernetMatch(ethernetMatch.build());
-
-        return match;
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetSource(new EthernetSourceBuilder().setAddress(new MacAddress("00:00:00:00:00:01")).build())
+                .build());
     }
 
     private static InstructionsBuilder createDropInstructions() {
-        DropActionBuilder dab = new DropActionBuilder();
-        DropAction dropAction = dab.build();
-        ActionBuilder ab = new ActionBuilder();
-        ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
-
-        // Add our drop action to a list
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new DropActionCaseBuilder()
+                                .setDropAction(new DropActionBuilder().build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static MatchBuilder createEthernetMatch() {
-        EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
-        // match
-        EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
-        EtherType type = new EtherType(Uint32.valueOf(0x0800));
-        ethmatch.setEthernetType(ethtype.setType(type).build());
-
-        EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder(); // ethernet
-        // macaddress
-        // match
-        MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
-        ethdest.setAddress(macdest);
-        // ethdest.setMask(mask1);
-
-        ethmatch.setEthernetDestination(ethdest.build());
-
-        EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
-        MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
-        ethsrc.setAddress(macsrc);
-        // ethsrc.setMask(mask2);
-
-        ethmatch.setEthernetSource(ethsrc.build());
-        MatchBuilder match = new MatchBuilder();
-        match.setEthernetMatch(ethmatch.build());
-        return match;
-
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .setEthernetDestination(new EthernetDestinationBuilder()
+                    .setAddress(new MacAddress("ff:ff:ff:ff:ff:ff"))
+                    // .setMask(mask1);
+                    .build())
+                .setEthernetSource(new EthernetSourceBuilder()
+                    .setAddress(new MacAddress("00:00:00:00:23:ae"))
+                    // .setMask(mask2);
+                    .build())
+                .build());
     }
 
     private static InstructionsBuilder createMeterInstructions() {
-
-        MeterBuilder aab = new MeterBuilder();
-        aab.setMeterId(new MeterId(Uint32.ONE));
-
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new MeterCaseBuilder()
+                    .setMeter(new MeterBuilder().setMeterId(new MeterId(Uint32.ONE)).build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-        ControllerActionBuilder controller = new ControllerActionBuilder();
-        controller.setMaxLength(Uint16.valueOf(5));
-        ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new ControllerActionCaseBuilder()
+                                .setControllerAction(new ControllerActionBuilder()
+                                    .setMaxLength(Uint16.valueOf(5))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction7() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-
-        SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
-        VlanId vlanId = new VlanId(Uint16.valueOf(4012));
-        vl.setVlanId(vlanId);
-        ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new SetVlanIdActionCaseBuilder()
+                                .setSetVlanIdAction(new SetVlanIdActionBuilder()
+                                    .setVlanId(new VlanId(Uint16.valueOf(4012)))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction21() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-
-        PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
-        ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new PopVlanActionCaseBuilder()
+                                .setPopVlanAction(new PopVlanActionBuilder().build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction2() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-
-        PushMplsActionBuilder push = new PushMplsActionBuilder();
-        push.setEthernetType(Uint16.valueOf(0x8847));
-        ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new PushMplsActionCaseBuilder()
+                                .setPushMplsAction(new PushMplsActionBuilder()
+                                    .setEthernetType(Uint16.valueOf(0x8847))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction3() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-
-        PushPbbActionBuilder pbb = new PushPbbActionBuilder();
-        pbb.setEthernetType(Uint16.valueOf(0x88E7));
-        ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new PushPbbActionCaseBuilder()
+                                .setPushPbbAction(new PushPbbActionBuilder()
+                                    .setEthernetType(Uint16.valueOf(0x88E7))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createGotoTableInstructions() {
-
-        GoToTableBuilder aab = new GoToTableBuilder();
-        aab.setTableId(Uint8.TWO);
-
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setInstruction(new GoToTableCaseBuilder()
+                    .setGoToTable(new GoToTableBuilder().setTableId(Uint8.TWO).build())
+                    .build())
+                .build()));
     }
 
-    private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
+    private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
 
         FlowBuilder flow = new FlowBuilder();
         long id = 123;
@@ -514,7 +395,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }
 
         final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
-        if (null == flow.isBarrier()) {
+        if (null == flow.getBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
         // flow.setBufferId(12L);
@@ -539,7 +420,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         return flow;
     }
 
-    private static Uint8 getTableId(String tableId) {
+    private static Uint8 getTableId(final String tableId) {
         Uint8 table = Uint8.TWO;
         if (tableId == null) {
             return table;
@@ -555,7 +436,8 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
     }
 
-    public void _addGroups(CommandInterpreter ci) {
+    @SuppressWarnings("checkstyle:MethodName")
+    public void _addGroups(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
         if (nref == null) {
@@ -593,14 +475,12 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }
     }
 
-    private void createUserNode(String nodeRef) {
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(nodeRef));
-        builder.withKey(new NodeKey(builder.getId()));
-        testNode12 = builder.build();
+    private void createUserNode(final String nodeRef) {
+        testNode12 = new NodeBuilder().setId(new NodeId(nodeRef)).build();
     }
 
-    public void _modifyGroups(CommandInterpreter ci) {
+    @SuppressWarnings("checkstyle:MethodName")
+    public void _modifyGroups(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
         if (nref == null) {
@@ -638,11 +518,12 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }
     }
 
-    private static InstanceIdentifier<Node> nodeToInstanceId(Node node) {
+    private static InstanceIdentifier<Node> nodeToInstanceId(final Node node) {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
     }
 
-    public void _removeGroups(CommandInterpreter ci) {
+    @SuppressWarnings("checkstyle:MethodName")
+    public void _removeGroups(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
         if (nref == null) {
@@ -701,7 +582,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }
     }
 
-    private void writeGroup(final CommandInterpreter ci, Group group, Group group1) {
+    private void writeGroup(final CommandInterpreter ci, final Group group, final Group group1) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
 
         InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
@@ -719,18 +600,18 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path2, group1);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
         }, MoreExecutors.directExecutor());
     }
 
-    private void deleteGroup(final CommandInterpreter ci, Group group, Group group1) {
+    private void deleteGroup(final CommandInterpreter ci, final Group group, final Group group1) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
@@ -744,18 +625,19 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         modification.delete(LogicalDatastoreType.CONFIGURATION, path2);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
         }, MoreExecutors.directExecutor());
     }
 
-    private GroupBuilder createTestGroup(String actionType, String groupType, String groupmod, String strId) {
+    private GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod,
+            final String strId) {
         // Sample data , committing to DataStore
 
         GroupBuilder group = new GroupBuilder();
@@ -835,132 +717,102 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
             bucket.setWeight(Uint16.valueOf(30));
         }
 
-        GroupKey key = new GroupKey(new GroupId(Uint32.valueOf(strId)));
-        group.withKey(key);
-        // group.setInstall(false);
-        group.setGroupName(originalGroupName);
-        group.setBarrier(false);
-        BucketsBuilder value = new BucketsBuilder();
-        List<Bucket> value1 = new ArrayList<>();
-        value1.add(bucket.build());
-        value.setBucket(value1);
-        group.setBuckets(value.build());
-        return group;
-    }
-
-    private static List<Action> createPopVlanAction() {
-        PopVlanActionBuilder vlanAction = new PopVlanActionBuilder();
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
-        action.withKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createPushVlanAction() {
-        PushVlanActionBuilder vlan = new PushVlanActionBuilder();
-        vlan.setEthernetType(Uint16.valueOf(0x8100));
-        VlanId vlanId = new VlanId(Uint16.TWO);
-        vlan.setVlanId(vlanId);
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createPushMplsAction() {
-        PushMplsActionBuilder push = new PushMplsActionBuilder();
-        push.setEthernetType(Uint16.valueOf(0x8847));
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createPopMplsAction() {
-        PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
-        popMplsActionBuilder.setEthernetType(Uint16.valueOf(0XB));
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createPopPbbAction() {
-        PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createPushPbbAction() {
-        PushPbbActionBuilder pbb = new PushPbbActionBuilder();
-        pbb.setEthernetType(Uint16.valueOf(0x88E7));
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createCopyTtlInAction() {
-        CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createCopyTtlOutAction() {
-        CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createDecMplsTtlAction() {
-        DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createGroupAction() {
-
-        GroupActionBuilder groupActionB = new GroupActionBuilder();
-        groupActionB.setGroupId(Uint32.ONE);
-        groupActionB.setGroup("0");
-        ActionBuilder action = new ActionBuilder();
-        action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
-        action.withKey(new ActionKey(0));
-        List<Action> actions = new ArrayList<>();
-        actions.add(action.build());
-        return actions;
-    }
-
-    private static List<Action> createNonAppyPushVlanAction() {
-
-        ActionBuilder ab = new ActionBuilder();
-
-        GroupActionBuilder groupActionB = new GroupActionBuilder();
-        groupActionB.setGroupId(Uint32.ONE);
-        groupActionB.setGroup("0");
-        ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
-
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-
-        return actionList;
+        return group.withKey(new GroupKey(new GroupId(Uint32.valueOf(strId))))
+            // .group.setInstall(false)
+            .setGroupName(originalGroupName)
+            .setBarrier(false)
+            .setBuckets(new BucketsBuilder().setBucket(BindingMap.of(bucket.build())).build());
+    }
+
+    private static Map<ActionKey, Action> createPopVlanAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PopVlanActionCaseBuilder().setPopVlanAction(new PopVlanActionBuilder().build()).build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createPushVlanAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PushVlanActionCaseBuilder()
+                .setPushVlanAction(new PushVlanActionBuilder()
+                    .setEthernetType(Uint16.valueOf(0x8100))
+                    .setVlanId(new VlanId(Uint16.TWO))
+                    .build())
+                .build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createPushMplsAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PushMplsActionCaseBuilder()
+                .setPushMplsAction(new PushMplsActionBuilder().setEthernetType(Uint16.valueOf(0x8847)).build())
+                .build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createPopMplsAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PopMplsActionCaseBuilder()
+                .setPopMplsAction(new PopMplsActionBuilder().setEthernetType(Uint16.valueOf(0xB)).build())
+                .build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createPopPbbAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PopPbbActionCaseBuilder().setPopPbbAction(new PopPbbActionBuilder().build()).build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createPushPbbAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new PushPbbActionCaseBuilder()
+                .setPushPbbAction(new PushPbbActionBuilder().setEthernetType(Uint16.valueOf(0x88E7)).build())
+                .build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createCopyTtlInAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(new CopyTtlInBuilder().build()).build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createCopyTtlOutAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(new CopyTtlOutBuilder().build()).build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createDecMplsTtlAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(new DecMplsTtlBuilder().build()).build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createGroupAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new GroupActionCaseBuilder()
+                .setGroupAction(new GroupActionBuilder().setGroupId(Uint32.ONE).setGroup("0").build())
+                .build())
+            .build());
+    }
+
+    private static Map<ActionKey, Action> createNonAppyPushVlanAction() {
+        return BindingMap.of(new ActionBuilder()
+            .setOrder(0)
+            .setAction(new GroupActionCaseBuilder()
+                .setGroupAction(new GroupActionBuilder().setGroupId(Uint32.ONE).setGroup("0").build())
+                .build())
+            .build());
     }
 }
index 708146a15da7b3c9f77afa5feaacfaf003747231..358fc6e1cdfde64d854d02704db7bce12d6de36a 100644 (file)
@@ -40,9 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.copy.ttl.in._case.CopyTtlInBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder;
@@ -58,7 +56,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -80,13 +77,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.meter._case.MeterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
@@ -99,11 +94,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
@@ -112,18 +107,17 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressWarnings("checkstyle:MethodName")
 public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
-
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class);
+
     private final DataBroker dataBroker;
     private final BundleContext ctx;
     private final String originalFlowName = "Foo";
     private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
     private final NotificationService notificationService;
 
-    public OpenflowPluginBulkTransactionProvider(DataBroker dataBroker, NotificationService notificationService,
-            BundleContext ctx) {
+    public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker,
+            final NotificationService notificationService, final BundleContext ctx) {
         this.dataBroker = dataBroker;
         this.notificationService = notificationService;
         this.ctx = ctx;
@@ -139,10 +133,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         if (nodeId == null) {
             nodeId = OpenflowpluginTestActivator.NODE_ID;
         }
-        NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(nodeId));
-        builder.withKey(new NodeKey(builder.getId()));
-        return builder;
+        return new NodeBuilder().setId(new NodeId(nodeId));
     }
 
     @Override
@@ -150,7 +141,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return "No help";
     }
 
-    private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
+    private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
 
         FlowBuilder flow = new FlowBuilder();
         long id = 123;
@@ -391,7 +382,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
                 LOG.warn("flow type not understood: {}", flowType);
         }
 
-        if (null == flow.isBarrier()) {
+        if (null == flow.getBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
         // flow.setBufferId(12L);
@@ -417,7 +408,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return flow;
     }
 
-    private static Uint8 getTableId(String tableId) {
+    private static Uint8 getTableId(final String tableId) {
         if (tableId != null) {
             try {
                 return Uint8.valueOf(tableId);
@@ -428,7 +419,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return Uint8.TWO;
     }
 
-    public void _addFlows(CommandInterpreter ci) {
+    @SuppressWarnings("checkstyle:MethodName")
+    public void _addFlows(final CommandInterpreter ci) {
         NodeBuilder tn = createTestNode(ci.nextArgument());
         String flowtype = ci.nextArgument();
         Integer flowcnt = Integer.parseInt(flowtype);
@@ -481,11 +473,12 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         writeFlow(ci, tf, tf1, tf2, tf3, tn);
     }
 
-    private static InstanceIdentifier<Node> nodeBuilderToInstanceId(NodeBuilder node) {
+    private static InstanceIdentifier<Node> nodeBuilderToInstanceId(final NodeBuilder node) {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
     }
 
-    public void _modifyFlows(CommandInterpreter ci) {
+    @SuppressWarnings("checkstyle:MethodName")
+    public void _modifyFlows(final CommandInterpreter ci) {
         NodeBuilder tn = createTestNode(ci.nextArgument());
         String flowtype = ci.nextArgument();
         Integer flowcnt = Integer.parseInt(flowtype);
@@ -537,9 +530,9 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         }
 
         writeFlow(ci, tf, tf1, tf2, tf3, tn);
-
     }
 
+    @SuppressWarnings("checkstyle:MethodName")
     public void _removeFlows(final CommandInterpreter ci) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         NodeBuilder tn = createTestNode(ci.nextArgument());
@@ -645,12 +638,12 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         modification.delete(LogicalDatastoreType.CONFIGURATION, path4);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 LOG.error("Status of Group Data Loaded Transaction : failure.", throwable);
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
@@ -658,8 +651,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
 
     }
 
-    private void writeFlow(final CommandInterpreter ci, FlowBuilder flow, FlowBuilder flow1, FlowBuilder flow2,
-                           FlowBuilder flow3, NodeBuilder nodeBuilder) {
+    private void writeFlow(final CommandInterpreter ci, final FlowBuilder flow, final FlowBuilder flow1,
+                           final FlowBuilder flow2, final FlowBuilder flow3, final NodeBuilder nodeBuilder) {
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
@@ -701,12 +694,12 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path4, flow3.build());
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 LOG.error("Status of Group Data Loaded Transaction : failure.", throwable);
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
@@ -714,144 +707,91 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     }
 
     private static InstructionsBuilder createDecNwTtlInstructions() {
-        DecNwTtlBuilder ta = new DecNwTtlBuilder();
-        DecNwTtl decNwTtl = ta.build();
-        ActionBuilder ab = new ActionBuilder();
-        ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
-
-        // Add our drop action to a list
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-        ib.withKey(new InstructionKey(0));
-        ib.setOrder(0);
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new DecNwTtlCaseBuilder().setDecNwTtl(new DecNwTtlBuilder().build()).build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createMeterInstructions() {
-
-        MeterBuilder aab = new MeterBuilder();
-        aab.setMeterId(new MeterId(Uint32.ONE));
-
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new MeterCaseBuilder()
+                    .setMeter(new MeterBuilder().setMeterId(new MeterId(Uint32.ONE)).build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createGotoTableInstructions() {
-
-        GoToTableBuilder aab = new GoToTableBuilder();
-        aab.setTableId(Uint8.TWO);
-
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new GoToTableCaseBuilder()
+                    .setGoToTable(new GoToTableBuilder().setTableId(Uint8.TWO).build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createDropInstructions() {
-        DropActionBuilder dab = new DropActionBuilder();
-        DropAction dropAction = dab.build();
-        ActionBuilder ab = new ActionBuilder();
-        ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
-
-        // Add our drop action to a list
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new DropActionCaseBuilder()
+                                .setDropAction(new DropActionBuilder().build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction() {
-
-        List<Action> actionList = new ArrayList<>();
-        ActionBuilder ab = new ActionBuilder();
-        ControllerActionBuilder controller = new ControllerActionBuilder();
-        controller.setMaxLength(Uint16.valueOf(5));
-        ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setAction(new ControllerActionCaseBuilder()
+                                .setControllerAction(new ControllerActionBuilder()
+                                    .setMaxLength(Uint16.valueOf(5))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createSentToControllerInstructions() {
-        ActionBuilder ab = new ActionBuilder();
-
-        OutputActionBuilder output = new OutputActionBuilder();
-        output.setMaxLength(Uint16.MAX_VALUE);
-        Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
-        output.setOutputNodeConnector(value);
-        ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
-        ab.setOrder(0);
-        ab.withKey(new ActionKey(0));
-
-        List<Action> actionList = new ArrayList<>();
-        actionList.add(ab.build());
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-        ib.setOrder(0);
-        ib.withKey(new InstructionKey(0));
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-        return isb;
+        return new InstructionsBuilder()
+            .setInstruction(BindingMap.of(new InstructionBuilder()
+                .setOrder(0)
+                .setInstruction(new ApplyActionsCaseBuilder()
+                    .setApplyActions(new ApplyActionsBuilder()
+                        .setAction(BindingMap.of(new ActionBuilder()
+                            .setOrder(0)
+                            .setAction(new OutputActionCaseBuilder()
+                                .setOutputAction(new OutputActionBuilder()
+                                    .setMaxLength(Uint16.MAX_VALUE)
+                                    .setOutputNodeConnector(new Uri(OutputPortValues.CONTROLLER.toString()))
+                                    .build())
+                                .build())
+                            .build()))
+                        .build())
+                    .build())
+                .build()));
     }
 
     private static InstructionsBuilder createAppyActionInstruction2() {
@@ -1166,174 +1106,107 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     }
 
     private static MatchBuilder createLLDPMatch() {
-        MatchBuilder match = new MatchBuilder();
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x88cc)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x88cc))).build())
+                .build());
     }
 
     private static MatchBuilder createMatch1() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
-        ipv4Match.setIpv4Destination(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x0800)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
+        return new MatchBuilder()
+            .setLayer3Match(new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix("10.0.0.1/24")).build())
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .build());
     }
 
     private static MatchBuilder createMatch1000() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.1.1.1/24");
-        ipv4Match.setIpv4Destination(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x0800)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
+        return new MatchBuilder()
+            .setLayer3Match(new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix("10.1.1.1/24")).build())
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .build());
     }
 
     private static MatchBuilder createMatch2() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
-        ipv4Match.setIpv4Source(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x0800)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
+        return new MatchBuilder()
+            .setLayer3Match(new Ipv4MatchBuilder().setIpv4Source(new Ipv4Prefix("10.0.0.1")).build())
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .build());
     }
 
     private static MatchBuilder createMatch3() {
-        MatchBuilder match = new MatchBuilder();
-        EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
-        EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
-        ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
-        ethernetMatch.setEthernetSource(ethSourceBuilder.build());
-        match.setEthernetMatch(ethernetMatch.build());
-
-        return match;
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetSource(new EthernetSourceBuilder().setAddress(new MacAddress("00:00:00:00:00:01")).build())
+                .build());
     }
 
-    private static MatchBuilder createInphyportMatch(NodeId nodeId) {
-        MatchBuilder match = new MatchBuilder();
-        match.setInPort(new NodeConnectorId(nodeId + ":202"));
-        match.setInPhyPort(new NodeConnectorId(nodeId + ":10122"));
-        return match;
+    private static MatchBuilder createInphyportMatch(final NodeId nodeId) {
+        return new MatchBuilder()
+            .setInPort(new NodeConnectorId(nodeId + ":202"))
+            .setInPhyPort(new NodeConnectorId(nodeId + ":10122"));
     }
 
     private static MatchBuilder createEthernetMatch() {
-        EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
-        // match
-        EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
-        EtherType type = new EtherType(Uint32.valueOf(0x0800));
-        ethmatch.setEthernetType(ethtype.setType(type).build());
-
-        EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder(); // ethernet
-        // macaddress
-        // match
-        MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
-        ethdest.setAddress(macdest);
-        // ethdest.setMask(mask1);
-
-        ethmatch.setEthernetDestination(ethdest.build());
-
-        EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
-        MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
-        ethsrc.setAddress(macsrc);
-        // ethsrc.setMask(mask2);
-
-        ethmatch.setEthernetSource(ethsrc.build());
-
-        MatchBuilder match = new MatchBuilder();
-        match.setEthernetMatch(ethmatch.build());
-        return match;
-
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x0800))).build())
+                .setEthernetDestination(new EthernetDestinationBuilder()
+                    .setAddress(new MacAddress("ff:ff:ff:ff:ff:ff"))
+                    // .setMask(mask1)
+                    .build())
+                .setEthernetSource(new EthernetSourceBuilder()
+                    .setAddress(new MacAddress("00:00:00:00:23:ae"))
+                    // .setMask(mask2)
+                    .build())
+                .build());
     }
 
     private static MatchBuilder createL3IPv6Match() {
-        MatchBuilder match = new MatchBuilder();
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x86dd)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-
-        Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
-        Ipv6FlowLabel label = new Ipv6FlowLabel(Uint32.valueOf(10028));
-        ipv6label.setIpv6Flabel(label);
-        // ipv6label.setFlabelMask(new byte[] { 0, 1, -1, -1 });
-
-        Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
-        // match
-        icmpv6match.setIcmpv6Type(Uint8.valueOf(135));
-        icmpv6match.setIcmpv6Code(Uint8.ZERO);
-        match.setIcmpv6Match(icmpv6match.build());
-
-        Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
-        // ipv6match.setIpv6Source(srcip6);
-        // ipv6match.setIpv6Destination(dstip6);
-        // ipv6match.setIpv6ExtHeader(nextheader.build());
-
-        ipv6match.setIpv6NdSll(new MacAddress("c2:00:54:f5:00:00"));
-        ipv6match.setIpv6NdTll(new MacAddress("00:0c:29:0e:4c:67"));
-        // ipv6match.setIpv6NdTarget(ndtarget);
-        ipv6match.setIpv6Label(ipv6label.build());
-
-        match.setLayer3Match(ipv6match.build());
-
-        return match;
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x86dd))).build())
+                .build())
+            // icmpv6
+            .setIcmpv6Match(new Icmpv6MatchBuilder()
+                .setIcmpv6Type(Uint8.valueOf(135))
+                .setIcmpv6Code(Uint8.ZERO)
+                .build())
+            .setLayer3Match(new Ipv6MatchBuilder()
+                // .setIpv6Source(srcip6)
+                // .setIpv6Destination(dstip6)
+                // .setIpv6ExtHeader(nextheader.build())
+                .setIpv6NdSll(new MacAddress("c2:00:54:f5:00:00"))
+                .setIpv6NdTll(new MacAddress("00:0c:29:0e:4c:67"))
+                // .setIpv6NdTarget(ndtarget)
+                .setIpv6Label(new Ipv6LabelBuilder()
+                    .setIpv6Flabel(new Ipv6FlowLabel(Uint32.valueOf(10028)))
+                    // .setFlabelMask(new byte[] { 0, 1, -1, -1 })
+                    .build())
+                .build());
     }
 
     private static MatchBuilder createICMPv6Match() {
-
-        MatchBuilder match = new MatchBuilder();
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(Uint32.valueOf(0x86dd)));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-
-        IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
-        ipmatch.setIpProtocol(Uint8.valueOf(58));
-        match.setIpMatch(ipmatch.build());
-
-        Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
-        // match
-        icmpv6match.setIcmpv6Type(Uint8.valueOf(135));
-        icmpv6match.setIcmpv6Code(Uint8.ONE);
-        match.setIcmpv6Match(icmpv6match.build());
-
-        return match;
+        return new MatchBuilder()
+            .setEthernetMatch(new EthernetMatchBuilder()
+                .setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Uint32.valueOf(0x86dd))).build())
+                .build())
+            // ipv4 version
+            .setIpMatch(new IpMatchBuilder().setIpProtocol(Uint8.valueOf(58)).build())
+            // icmpv6
+            .setIcmpv6Match(new Icmpv6MatchBuilder()
+                .setIcmpv6Type(Uint8.valueOf(135))
+                .setIcmpv6Code(Uint8.ONE)
+                .build());
     }
 
     private static MatchBuilder createMetadataMatch() {
-        MatchBuilder match = new MatchBuilder();
-        MetadataBuilder metadata = new MetadataBuilder(); // metadata match
-        metadata.setMetadata(Uint64.valueOf(500));
-        // metadata.setMetadataMask(metamask);
-        match.setMetadata(metadata.build());
-
-        return match;
+        return new MatchBuilder()
+            .setMetadata(new MetadataBuilder()
+                .setMetadata(Uint64.valueOf(500))
+                // .setMetadataMask(metamask)
+                .build());
     }
 }
index 0dc6a63e7a900db6a6d57dd65cbd67064c5b2f65..6ebcf4396a63984d12fb7e12796cf5d9728c54e0 100644 (file)
@@ -687,7 +687,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         }
 
         final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
-        if (null == flow.isBarrier()) {
+        if (null == flow.getBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
         flow.setCookie(new FlowCookie(Uint64.TEN));
@@ -729,7 +729,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         }
 
         final FlowKey key = new FlowKey(new FlowId(Long.toString(flowId)));
-        if (null == flow.isBarrier()) {
+        if (null == flow.getBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
         flow.setCookie(new FlowCookie(Uint64.TEN));