Added more event and listener interface definitions.
diff --git a/net/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java b/net/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java
index 3681be5..3af20ad 100644
--- a/net/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java
+++ b/net/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java
@@ -1,5 +1,9 @@
package org.onlab.onos.net.provider;
+import java.util.Objects;
+
+import static com.google.common.base.Objects.toStringHelper;
+
/**
* Notion of provider identity.
*/
@@ -7,37 +11,37 @@
private final String id;
+ /**
+ * Creates a new provider identifier from the specified string.
+ * The providers are expected to follow the reverse DNS convention, e.g.
+ * {@code org.onlab.onos.provider.of.device}
+ *
+ * @param id string identifier
+ */
public ProviderId(String id) {
this.id = id;
}
@Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- ProviderId that = (ProviderId) o;
-
- if (!id.equals(that.id)) {
- return false;
- }
-
- return true;
+ public int hashCode() {
+ return Objects.hash(id);
}
@Override
- public int hashCode() {
- return id.hashCode();
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ final ProviderId other = (ProviderId) obj;
+ return Objects.equals(this.id, other.id);
}
@Override
public String toString() {
- return "ProviderId{" +
- "id='" + id + '\'' +
- '}';
+ return toStringHelper(this).add("id", id).toString();
}
+
}