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
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());
}
- }
+ });
}
}