Fix checkstyle violations in openflowplugin extensions
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / direct / multilayer / FlowDirectStatisticsService.java
index 4075b6827b6be003ad084ce3d415bc25dbad983c..624a18566eb0582f46c21762fbc7a191aa086ae6 100644 (file)
@@ -47,7 +47,7 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
         super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
         data = new FlowStatsResponseConvertorData(getVersion());
         data.setDatapathId(getDatapathId());
-        data.setMatchPath(MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
+        data.setMatchPath(MatchPath.FLOWS_STATISTICS_RPC_MATCH);
     }
 
     @Override
@@ -61,15 +61,15 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
                 final Optional<List<FlowAndStatisticsMapList>> statsListPart = getConvertorExecutor().convert(
                     replyBody.getFlowStats(), data);
 
-                if (statsListPart.isPresent()) {
-                    for (final FlowAndStatisticsMapList part : statsListPart.get()) {
+                statsListPart.ifPresent(flowAndStatisticsMapLists -> {
+                    for (final FlowAndStatisticsMapList part : flowAndStatisticsMapLists) {
                         final FlowId flowId = new FlowId(generateFlowId(part).getValue());
                         statsList.add(new FlowAndStatisticsMapListBuilder(part)
-                            .setKey(new FlowAndStatisticsMapListKey(flowId))
-                            .setFlowId(flowId)
-                            .build());
+                                .setKey(new FlowAndStatisticsMapListKey(flowId))
+                                .setFlowId(flowId)
+                                .build());
                     }
-                }
+                });
             }
         }