package org.opendaylight.controller.protocol_plugin.openflow.internal;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.opendaylight.controller.sal.core.Node;
/**
* Converts an openflow list of port statistics in a SAL list of
* NodeConnectorStatistics objects
- *
- *
- *
+ *
+ *
+ *
*/
public class PortStatisticsConverter {
private static final Logger log = LoggerFactory
public PortStatisticsConverter(long switchId, List<OFStatistics> statsList) {
this.switchId = switchId;
if (statsList == null || statsList.isEmpty()) {
- this.ofStatsList = new ArrayList<OFStatistics>(1); // dummy list
+ this.ofStatsList = Collections.emptyList();
} else {
this.ofStatsList = new ArrayList<OFStatistics>(statsList);
}