1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-23 06:42:05 +01:00

#hashcode and #equals. SMACK-54

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4348 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Alex Wenckus 2006-07-11 01:45:45 +00:00 committed by alex
parent 0fdda5bc4d
commit 1a08715f67

View file

@ -101,4 +101,21 @@ public class Occupant {
public String getNick() { public String getNick() {
return nick; return nick;
} }
public boolean equals(Object obj) {
if(!(obj instanceof Occupant)) {
return false;
}
Occupant occupant = (Occupant)obj;
return jid.equals(occupant.jid);
}
public int hashCode() {
int result;
result = affiliation.hashCode();
result = 17 * result + role.hashCode();
result = 17 * result + jid.hashCode();
result = 17 * result + (nick != null ? nick.hashCode() : 0);
return result;
}
} }