Improve coverage for some classes
- DefaultPatchDescription
- BridgeName
- DefaultQosDescription
- AbstractPathService
Change-Id: Ic2fad1d94578555701c1c1d1fc2e9a8cb167de84
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/DefaultPatchDescription.java b/core/api/src/main/java/org/onosproject/net/behaviour/DefaultPatchDescription.java
index 8d13c68..9450f39 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/DefaultPatchDescription.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/DefaultPatchDescription.java
@@ -20,6 +20,7 @@
import org.onosproject.net.AbstractDescription;
import org.onosproject.net.SparseAnnotations;
+import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkArgument;
@@ -61,6 +62,26 @@
}
@Override
+ public int hashCode() {
+ return Objects.hash(deviceId, ifaceName, peerName);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof DefaultPatchDescription) {
+ final DefaultPatchDescription that = (DefaultPatchDescription) obj;
+ return this.getClass() == that.getClass() &&
+ Objects.equals(this.deviceId, that.deviceId) &&
+ Objects.equals(this.ifaceName, that.ifaceName) &&
+ Objects.equals(this.peerName, that.peerName);
+ }
+ return false;
+ }
+
+ @Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("deviceId", deviceId)