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 be6f7bf951e..473ea559b64 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,21 @@ 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(); + } }