Added more event and listener interface definitions.
diff --git a/net/api/src/main/java/org/onlab/onos/net/DeviceId.java b/net/api/src/main/java/org/onlab/onos/net/DeviceId.java
index ebb3fb7..45528a4 100644
--- a/net/api/src/main/java/org/onlab/onos/net/DeviceId.java
+++ b/net/api/src/main/java/org/onlab/onos/net/DeviceId.java
@@ -1,9 +1,12 @@
package org.onlab.onos.net;
import java.net.URI;
+import java.util.Objects;
+
+import static com.google.common.base.Objects.toStringHelper;
/**
- * Immutable representaion of a device identity.
+ * Immutable representation of a device identity.
*/
public class DeviceId {
@@ -22,4 +25,25 @@
return uri;
}
+ @Override
+ public int hashCode() {
+ return Objects.hash(uri);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ final DeviceId other = (DeviceId) obj;
+ return Objects.equals(this.uri, other.uri);
+ }
+ @Override
+ public String toString() {
+ return toStringHelper(this).add("uri", uri).toString();
+ }
+
}