Example #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BaseName.Length != 0)
            {
                hash ^= BaseName.GetHashCode();
            }
            if (BaseTime != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseTime);
            }
            if (BaseUnit.Length != 0)
            {
                hash ^= BaseUnit.GetHashCode();
            }
            if (BaseVersion != 0)
            {
                hash ^= BaseVersion.GetHashCode();
            }
            if (baseValueOptionalCase_ == BaseValueOptionalOneofCase.BaseValue)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseValue);
            }
            if (baseSumOptionalCase_ == BaseSumOptionalOneofCase.BaseSum)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseSum);
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Unit.Length != 0)
            {
                hash ^= Unit.GetHashCode();
            }
            if (Time != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Time);
            }
            if (UpdateTime != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UpdateTime);
            }
            if (valueOneofCase_ == ValueOneofOneofCase.Value)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Value);
            }
            if (valueOneofCase_ == ValueOneofOneofCase.StringValue)
            {
                hash ^= StringValue.GetHashCode();
            }
            if (valueOneofCase_ == ValueOneofOneofCase.DataValue)
            {
                hash ^= DataValue.GetHashCode();
            }
            if (valueOneofCase_ == ValueOneofOneofCase.BoolValue)
            {
                hash ^= BoolValue.GetHashCode();
            }
            if (sumOptionalCase_ == SumOptionalOneofCase.Sum)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Sum);
            }
            hash ^= (int)baseValueOptionalCase_;
            hash ^= (int)baseSumOptionalCase_;
            hash ^= (int)valueOneofCase_;
            hash ^= (int)sumOptionalCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 /// <summary>
 /// Return a hash of this Quantity/BaseUnit pair.
 ///
 /// <remarks>No clue if this is a good hash. Probably isn't.</remarks>
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(BaseUnit.GetHashCode());
 }