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/device/DefaultDeviceDescription.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/device/DefaultDeviceDescription.java')
-rw-r--r-- | framework/src/onos/core/api/src/main/java/org/onosproject/net/device/DefaultDeviceDescription.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/device/DefaultDeviceDescription.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/device/DefaultDeviceDescription.java index 0fcc800d..9074792c 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/device/DefaultDeviceDescription.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/device/DefaultDeviceDescription.java @@ -24,6 +24,7 @@ import java.net.URI; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkNotNull; import static org.onosproject.net.Device.Type; +import com.google.common.base.Objects; /** * Default implementation of immutable device description entity. @@ -132,6 +133,30 @@ public class DefaultDeviceDescription extends AbstractDescription .toString(); } + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), uri, type, manufacturer, + hwVersion, swVersion, serialNumber, chassisId); + } + + @Override + public boolean equals(Object object) { + if (object instanceof DefaultDeviceDescription) { + if (!super.equals(object)) { + return false; + } + DefaultDeviceDescription that = (DefaultDeviceDescription) object; + return Objects.equal(this.uri, that.uri) + && Objects.equal(this.type, that.type) + && Objects.equal(this.manufacturer, that.manufacturer) + && Objects.equal(this.hwVersion, that.hwVersion) + && Objects.equal(this.swVersion, that.swVersion) + && Objects.equal(this.serialNumber, that.serialNumber) + && Objects.equal(this.chassisId, that.chassisId); + } + return false; + } + // default constructor for serialization private DefaultDeviceDescription() { this.uri = null; |