mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1229 - Implement equals and hashCode on ModifyAwareMap, ModifyAwareList and ModifyAwareSet
This commit is contained in:
@@ -2,6 +2,7 @@ package io.ebeaninternal.json;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,19 @@ public class ModifyAwareSet<E> implements Set<E>, ModifyAwareOwner {
|
||||
return set.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ModifyAwareSet)) return false;
|
||||
ModifyAwareSet<?> that = (ModifyAwareSet<?>) o;
|
||||
return Objects.equals(set, that.set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(E o) {
|
||||
if (set.add(o)) {
|
||||
|
||||
Reference in New Issue
Block a user