aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/UnknownField.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ProtocolBuffers/UnknownField.cs')
-rw-r--r--src/ProtocolBuffers/UnknownField.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ProtocolBuffers/UnknownField.cs b/src/ProtocolBuffers/UnknownField.cs
index 15ab216b..1873e302 100644
--- a/src/ProtocolBuffers/UnknownField.cs
+++ b/src/ProtocolBuffers/UnknownField.cs
@@ -113,6 +113,29 @@ namespace Google.ProtocolBuffers {
get { return groupList; }
}
+ public override bool Equals(object other) {
+ if (ReferenceEquals(this, other)) {
+ return true;
+ }
+ UnknownField otherField = other as UnknownField;
+ return otherField != null
+ && Lists.Equals(varintList, otherField.varintList)
+ && Lists.Equals(fixed32List, otherField.fixed32List)
+ && Lists.Equals(fixed64List, otherField.fixed64List)
+ && Lists.Equals(lengthDelimitedList, otherField.lengthDelimitedList)
+ && Lists.Equals(groupList, otherField.groupList);
+ }
+
+ public override int GetHashCode() {
+ int hash = 43;
+ hash = hash * 47 + Lists.GetHashCode(varintList);
+ hash = hash * 47 + Lists.GetHashCode(fixed32List);
+ hash = hash * 47 + Lists.GetHashCode(fixed64List);
+ hash = hash * 47 + Lists.GetHashCode(lengthDelimitedList);
+ hash = hash * 47 + Lists.GetHashCode(groupList);
+ return hash;
+ }
+
/// <summary>
/// Constructs a new Builder.
/// </summary>