changeable equals and hashcode added
This commit is contained in:
parent
8ecbc0fb33
commit
c82002c659
|
|
@ -83,4 +83,19 @@ public class Changeable<T> implements Serializable {
|
|||
subject = BehaviorSubject.create((T) inputStream.readObject());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (this == object) return true;
|
||||
if (object == null || getClass() != object.getClass()) return false;
|
||||
|
||||
final Changeable<?> that = (Changeable<?>) object;
|
||||
return subject.getValue() != null ? subject.getValue().equals(that.subject.getValue()) : that.subject.getValue() == null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return subject.getValue() != null ? subject.getValue().hashCode() : 0;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue