Skip to content

Commit

Permalink
Add equals and hashCode methods for the MemoryThreePid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoly Sablin committed Jan 9, 2020
1 parent 0d6f65b commit 47f6239
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/io/kamax/mxisd/config/memory/MemoryThreePid.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,21 @@ public void setAddress(String address) {
this.address = address;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

MemoryThreePid threePid = (MemoryThreePid) o;

if (!medium.equals(threePid.medium)) return false;
return address.equals(threePid.address);
}

@Override
public int hashCode() {
int result = medium.hashCode();
result = 31 * result + address.hashCode();
return result;
}
}

0 comments on commit 47f6239

Please sign in to comment.