Added hashCode and equal to main server objects

This commit is contained in:
magenoxx 2017-04-20 20:06:52 +03:00
parent 21eb420c16
commit 27a454f042
14 changed files with 614 additions and 31 deletions

View file

@ -57,4 +57,23 @@ public class LookedAtView implements Serializable {
public SimpleCardsView getCards() {
return cards;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final LookedAtView that = (LookedAtView) o;
if (!getName().equals(that.getName())) return false;
return getCards().equals(that.getCards());
}
@Override
public int hashCode() {
int result = getName().hashCode();
result = 31 * result + getCards().hashCode();
return result;
}
}