Skip to content

Commit

Permalink
Issue #350: Added missing 'hashCode' and 'equals' methods.
Browse files Browse the repository at this point in the history
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
  • Loading branch information
Juergen Fickel committed May 17, 2019
1 parent c7336ab commit 67cd61d
Showing 1 changed file with 23 additions and 0 deletions.
Expand Up @@ -12,6 +12,9 @@
*/
package org.eclipse.ditto.services.thingsearch.persistence.write.model;

import java.util.Objects;

import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;

import org.bson.Document;
Expand Down Expand Up @@ -60,4 +63,24 @@ private static UpdateOptions upsert() {
return new UpdateOptions().upsert(true);
}

@Override
public boolean equals(@Nullable final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
final ThingWriteModel that = (ThingWriteModel) o;
return thingDocument.equals(that.thingDocument);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), thingDocument);
}

}

0 comments on commit 67cd61d

Please sign in to comment.