diff options
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/FieldSet.java')
-rw-r--r-- | java/core/src/main/java/com/google/protobuf/FieldSet.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/FieldSet.java b/java/core/src/main/java/com/google/protobuf/FieldSet.java index 47924b65..4e89709f 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldSet.java +++ b/java/core/src/main/java/com/google/protobuf/FieldSet.java @@ -120,6 +120,25 @@ final class FieldSet<FieldDescriptorType extends public boolean isImmutable() { return isImmutable; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (!(o instanceof FieldSet)) { + return false; + } + + FieldSet<?> other = (FieldSet<?>) o; + return other.fields.equals(other.fields); + } + + @Override + public int hashCode() { + return fields.hashCode(); + } /** * Clones the FieldSet. The returned FieldSet will be mutable even if the |