diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java index be6f7bf951..feb5f987a2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java @@ -147,4 +147,22 @@ public class Device implements Serializable{ "]"; } + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof Device)) + return false; + + Device device = (Device) o; + + return getDeviceIdentifier().equals(device.getDeviceIdentifier()); + + } + + @Override + public int hashCode() { + return getDeviceIdentifier().hashCode(); + } + }