diff options
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/mock')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/mock/MockContactGroup.java | 25 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java | 9 |
2 files changed, 34 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; diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java b/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java index bcff799..a7b6e5e 100644 --- a/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java +++ b/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java @@ -294,6 +294,15 @@ public class MockProvider } /** + * Always true. + */ + @Override + public boolean validateContactAddress(String contactId, List<String> result) + { + return true; + } + + /** * Mock implementation of the corresponding ProtocolProviderService method. * We have no icon corresponding to this protocol provider. */ |