Fix checkstyle violations in openflowplugin extensions
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / main / java / org / opendaylight / openflowplugin / extension / vendor / nicira / convertor / action / ResubmitConvertor.java
index 940538d4e821630bbc3abcef9acf3b609046c61e..6491eaa1016ef1360e73ba38e29ef9123568dccf 100644 (file)
@@ -30,14 +30,28 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmitBuilder;
 
 /**
- * Convert to/from SAL flow model to openflowjava model for Resubmit action
+ * Convert to/from SAL flow model to openflowjava model for Resubmit action.
  */
 public class ResubmitConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionResubmitGrouping);
+        NxActionResubmitGrouping nxAction = (NxActionResubmitGrouping) nxActionArg;
+        ActionResubmitBuilder builder = new ActionResubmitBuilder();
+        NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
+        nxActionResubmitBuilder.setInPort(nxAction.getNxResubmit().getInPort());
+        nxActionResubmitBuilder.setTable(nxAction.getNxResubmit().getTable());
+        builder.setNxActionResubmit(nxActionResubmitBuilder.build());
+        return ActionUtil.createAction(builder.build());
+    }
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionResubmit action = ((ActionResubmit) input.getActionChoice()).getNxActionResubmit();
         NxResubmitBuilder builder = new NxResubmitBuilder();
         builder.setInPort(action.getInPort());
@@ -45,37 +59,29 @@ public class ResubmitConvertor implements
         return resolveAction(builder.build(), path);
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxResubmit value, final ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxResubmit value, final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionResubmitNodesNodeTableFlowWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxResubmit(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionResubmitNotifGroupDescStatsUpdatedCaseBuilder().setNxResubmit(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxResubmit(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionResubmitNodesNodeTableFlowApplyActionsCaseBuilder().setNxResubmit(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionResubmitGrouping);
-        NxActionResubmitGrouping nxAction = (NxActionResubmitGrouping) nxActionArg;
-        ActionResubmitBuilder builder = new ActionResubmitBuilder();
-        NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
-        nxActionResubmitBuilder.setInPort(nxAction.getNxResubmit().getInPort());
-        nxActionResubmitBuilder.setTable(nxAction.getNxResubmit().getTable());
-        builder.setNxActionResubmit(nxActionResubmitBuilder.build());
-        return ActionUtil.createAction(builder.build());
-    }
-
 }