Added unit tests for the event abstractions.
Added Element as the notion of common ancestry between Device and Host.
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 45528a4..124fa96 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,49 +1,19 @@
package org.onlab.onos.net;
import java.net.URI;
-import java.util.Objects;
-
-import static com.google.common.base.Objects.toStringHelper;
/**
* Immutable representation of a device identity.
*/
-public class DeviceId {
-
- private final URI uri;
-
- public DeviceId(URI uri) {
- this.uri = uri;
- }
+public class DeviceId extends ElementId {
/**
- * Returns the backing URI.
+ * Creates a device id using the supplied URI.
*
- * @return backing device URI
+ * @param uri backing device URI
*/
- public URI uri() {
- 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();
+ public DeviceId(URI uri) {
+ super(uri);
}
}