From 2e0d470ecfaac00147c210a0df7de645f95aa37f Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Fri, 3 Apr 2015 01:23:50 -0300 Subject: [PATCH] Bug WISE-421 #resolve --- .../com/wisemapping/model/Collaboration.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java b/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java index e9c5b982..6180248f 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Collaboration.java @@ -100,4 +100,28 @@ public class Collaboration { return this.getRole().ordinal() <= role.ordinal(); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Collaboration that = (Collaboration) o; + + if (id != that.id) return false; + if (collaborator != null ? !collaborator.equals(that.collaborator) : that.collaborator != null) return false; + if (mindMap != null ? !mindMap.equals(that.mindMap) : that.mindMap != null) return false; + if (role != that.role) return false; + + return true; + } + + @Override + public int hashCode() { + int result = (int) (id ^ (id >>> 32)); + result = 31 * result + (role != null ? role.hashCode() : 0); + result = 31 * result + (mindMap != null ? mindMap.hashCode() : 0); + result = 31 * result + (collaborator != null ? collaborator.hashCode() : 0); + return result; + } }