2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.equivalence;
11 import com.google.common.base.Equivalence;
12 import com.google.common.base.Function;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
15 import javax.annotation.Nullable;
18 * A simple fabric for equivalence rules
19 * and for functions used in converting Lists to Sets with our own equivalence rules
22 public class EquivalenceFabric {
24 private EquivalenceFabric(){
25 throw new UnsupportedOperationException("Can not create an instance");
28 public static final FlowEquivalence FLOW_EQUIVALENCE = new FlowEquivalence();
29 public static final Function<Flow, Equivalence.Wrapper<Flow>> FLOW_WRAPPER_FUNCTION =
30 new Function<Flow, Equivalence.Wrapper<Flow>>() {
33 public Equivalence.Wrapper<Flow> apply(@Nullable Flow input) {
34 return FLOW_EQUIVALENCE.wrap(input);
38 public static final MatchEquivalence MATCH_EQUIVALENCE = new MatchEquivalence();