Skip to content

Commit

Permalink
Adding generated equals methods
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Aug 15, 2018
1 parent 7ea5d01 commit a8e3ac1
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.firestore.v1beta1.DocumentTransform.FieldTransform;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;

/** Sentinel values that can be used when writing document fields with set() or update(). */
Expand Down Expand Up @@ -112,6 +113,21 @@ FieldTransform toProto(FieldPath path) {
fieldTransform.setAppendMissingElements(encodedElements);
return fieldTransform.build();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
ArrayUnionFieldValue that = (ArrayUnionFieldValue) o;
return Objects.equals(elements, that.elements);
}
}

static class ArrayRemoveFieldValue extends FieldValue {
Expand Down Expand Up @@ -150,6 +166,21 @@ FieldTransform toProto(FieldPath path) {
fieldTransform.setRemoveAllFromArray(encodedElements);
return fieldTransform.build();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
ArrayRemoveFieldValue that = (ArrayRemoveFieldValue) o;
return Objects.equals(elements, that.elements);
}
}

private FieldValue() {}
Expand Down

0 comments on commit a8e3ac1

Please sign in to comment.