diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
commit | 77ce3be7567bd01c66d8ee88a93b485666723501 (patch) | |
tree | 283e7f39a501750bbd705fbb91645b20198900f1 /framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java | |
parent | 00e6500d0813dcbccaaa741ef38cc1eae6d11e07 (diff) |
Removed patch path since changes have been merged upstream to a different path. Updated README with directions.
Change-Id: Ie419abd2d3d3ef7315de9f607dcd757a78190995
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java')
-rw-r--r-- | framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java index 1f05197a..307a6078 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java @@ -28,6 +28,7 @@ import org.onlab.packet.VlanId; import com.google.common.collect.ImmutableSet; import static com.google.common.base.MoreObjects.toStringHelper; +import com.google.common.base.Objects; /** * Default implementation of an immutable host description. @@ -119,4 +120,24 @@ public class DefaultHostDescription extends AbstractDescription .toString(); } + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), mac, vlan, location, ip); + } + + @Override + public boolean equals(Object object) { + if (object != null && getClass() == object.getClass()) { + if (!super.equals(object)) { + return false; + } + DefaultHostDescription that = (DefaultHostDescription) object; + return Objects.equal(this.mac, that.mac) + && Objects.equal(this.vlan, that.vlan) + && Objects.equal(this.location, that.location) + && Objects.equal(this.ip, that.ip); + } + return false; + } + } |