Merge pull request #208 from laki88/master

override hash and equals function in Device to avoid duplicates in co…
This commit is contained in:
inoshperera 2016-04-08 12:09:52 +05:30
commit 0f355fe1d8

View File

@ -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();
}
}