import java.util.Comparator;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.PathAttributes;
-
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.PathAttributes;
/**
* This comparator is intended to implement BGP Best Path Selection algorithm, as described at
* @param <T> Actual object state reference
*/
final class BGPObjectComparator implements Comparator<PathAttributes> {
+ public static final BGPObjectComparator INSTANCE = new BGPObjectComparator();
+
+ private BGPObjectComparator() {
+ }
+
@Override
public int compare(final PathAttributes o1, final PathAttributes o2) {
- if (o1 == o2) {
- return 0;
- }
if (o1 == null) {
return 1;
}
if (o2 == null) {
return -1;
}
+ if (o1.equals(o2)) {
+ return 0;
+ }
- // FIXME: look at ASPath
- // FIXME: look at everything else :-)
+ // FIXME: BUG-185: implement here
return 0;
}