Add equals() and hashCode() to Account class

Change-Id: I382537f1fc18e68d2c2f1542d12cebd08b1a8ac0
This commit is contained in:
Deniz Türkoglu
2013-02-19 19:31:58 +01:00
parent 3cfb54b4f3
commit a88d8434cb

View File

@@ -228,4 +228,14 @@ public final class Account {
public void setUserName(final String userName) {
this.userName = userName;
}
@Override
public boolean equals(Object o) {
return o instanceof Account && ((Account) o).getId().equals(getId());
}
@Override
public int hashCode() {
return getId().get();
}
}