aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java b/src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java
index fa4fff1..e6cdd36 100644
--- a/src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java
+++ b/src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java
@@ -506,6 +506,31 @@ public class MockContactGroup
return true;
}
+ @Override
+ public int hashCode()
+ {
+ List<Object> objects = new ArrayList<Object>();
+ objects.add(getGroupName());
+ objects.add(getUID());
+ objects.add(countContacts());
+ objects.add(countSubgroups());
+
+ //traverse child contacts
+ for (Contact c : contacts)
+ {
+ objects.add(c.getAddress());
+ }
+
+
+ //traverse subgroups
+ for (ContactGroup g : subGroups)
+ {
+ objects.add(g.getGroupName());
+ }
+
+ return Objects.hash(objects.toArray());
+ }
+
public void setPersistent(boolean isPersistent)
{
this.isPersistent = isPersistent;