Bug 5540 - Multiple convert types for one convertor
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / flow / FlowStatsResponseConvertor.java
index 9e6ddf2aed1945f4595116132eb351a94aebd610..19f25de81e42dfb449c92a9024feec0ececa38d9 100644 (file)
@@ -10,9 +10,11 @@ package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.extension.api.AugmentTuple;
 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
@@ -56,6 +58,8 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
  */
 public class FlowStatsResponseConvertor implements Convertor<List<FlowStats>, List<FlowAndStatisticsMapList>, VersionDatapathIdConvertorData> {
 
+    private static final Set<Class<? extends DataContainer>> TYPES = Collections.singleton(FlowStats.class);
+
     /**
      * Method wraps openflow 1.0 actions list to Apply Action Instructions
      *
@@ -90,8 +94,8 @@ public class FlowStatsResponseConvertor implements Convertor<List<FlowStats>, Li
     }
 
     @Override
-    public Class<? extends DataContainer> getType() {
-        return FlowStats.class;
+    public Collection<Class<? extends DataContainer>> getTypes() {
+        return TYPES;
     }
 
     @Override