Example #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (ObservationType != null)
                {
                    hashCode = hashCode * 59 + ObservationType.GetHashCode();
                }
                if (ThingId != null)
                {
                    hashCode = hashCode * 59 + ThingId.GetHashCode();
                }
                if (StartTime != null)
                {
                    hashCode = hashCode * 59 + StartTime.GetHashCode();
                }
                if (EndTime != null)
                {
                    hashCode = hashCode * 59 + EndTime.GetHashCode();
                }

                return(hashCode);
            }
        }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            hash ^= shape_.GetHashCode();
            if (CompressionType != 0)
            {
                hash ^= CompressionType.GetHashCode();
            }
            if (observationDataCase_ == ObservationDataOneofCase.CompressedData)
            {
                hash ^= CompressedData.GetHashCode();
            }
            if (observationDataCase_ == ObservationDataOneofCase.FloatData)
            {
                hash ^= FloatData.GetHashCode();
            }
            hash ^= compressedChannelMapping_.GetHashCode();
            hash ^= dimensionProperties_.GetHashCode();
            if (ObservationType != 0)
            {
                hash ^= ObservationType.GetHashCode();
            }
            hash ^= (int)observationDataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #3
0
 /// <summary>
 /// 哈希数
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(BandOrFrequency.GetHashCode() ^ 7 + Attribute.GetHashCode() ^ 3 + ObservationType.GetHashCode() * 3);
 }