Fixed equals methods for better efficiency.
Cleaned up ClusterService API.
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java b/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
index 502eee1..9f0e20b 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
@@ -43,6 +43,9 @@
@Override
public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
if (obj instanceof ClusterId) {
final ClusterId other = (ClusterId) obj;
return Objects.equals(this.id, other.id);
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyCluster.java b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyCluster.java
index f33dcf7..b6cc9bd 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyCluster.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyCluster.java
@@ -59,6 +59,9 @@
@Override
public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
if (obj instanceof DefaultTopologyCluster) {
final DefaultTopologyCluster other = (DefaultTopologyCluster) obj;
return Objects.equals(this.id, other.id) &&
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyEdge.java b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyEdge.java
index 00eb3d2..c399f3c 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyEdge.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyEdge.java
@@ -50,6 +50,9 @@
@Override
public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
if (obj instanceof DefaultTopologyEdge) {
final DefaultTopologyEdge other = (DefaultTopologyEdge) obj;
return Objects.equals(this.link, other.link);
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyVertex.java b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyVertex.java
index 7bc231e..4337f58 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyVertex.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/DefaultTopologyVertex.java
@@ -32,6 +32,9 @@
@Override
public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
if (obj instanceof DefaultTopologyVertex) {
final DefaultTopologyVertex other = (DefaultTopologyVertex) obj;
return Objects.equals(this.deviceId, other.deviceId);