package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.equivalence;
+import javax.annotation.Nullable;
+
import com.google.common.base.Equivalence;
import com.google.common.base.Function;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-
-import javax.annotation.Nullable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
/**
- * A simple fabric for equivalence rules
- * and for functions used in converting Lists to Sets with our own equivalence rules
- *
+ * A simple fabric for equivalence rules and for functions used<br>
+ * in converting Lists to Sets with our own equivalence rules
*/
public class EquivalenceFabric {
- private EquivalenceFabric(){
+ private EquivalenceFabric() {
throw new UnsupportedOperationException("Can not create an instance");
}
+ // Flow
public static final FlowEquivalence FLOW_EQUIVALENCE = new FlowEquivalence();
+ public static final MatchEquivalence MATCH_EQUIVALENCE = new MatchEquivalence();
+
public static final Function<Flow, Equivalence.Wrapper<Flow>> FLOW_WRAPPER_FUNCTION =
new Function<Flow, Equivalence.Wrapper<Flow>>() {
+
@Nullable
@Override
public Equivalence.Wrapper<Flow> apply(@Nullable Flow input) {
}
};
- public static final MatchEquivalence MATCH_EQUIVALENCE = new MatchEquivalence();
+ // Group
+ public static final BucketsEquivalence BUCKETS_EQUIVALENCE = new BucketsEquivalence();
+ public static final GroupEquivalence GROUP_EQUIVALENCE = new GroupEquivalence();
+
+ public static final Function<Group, Equivalence.Wrapper<Group>> GROUP_WRAPPER_FUNCTION =
+ new Function<Group, Equivalence.Wrapper<Group>>() {
+
+ @Nullable
+ @Override
+ public Equivalence.Wrapper<Group> apply(@Nullable Group input) {
+ return GROUP_EQUIVALENCE.wrap(input);
+ }
+ };
}