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; + } }