Beispiel #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 (ServiceName != null)
         {
             hashCode = hashCode * 59 + ServiceName.GetHashCode();
         }
         if (Ipv4 != null)
         {
             hashCode = hashCode * 59 + Ipv4.GetHashCode();
         }
         if (Ipv6 != null)
         {
             hashCode = hashCode * 59 + Ipv6.GetHashCode();
         }
         if (Port != null)
         {
             hashCode = hashCode * 59 + Port.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hashcode = 0;

            unchecked {
                hashcode = (hashcode * 397) ^ (Ipv4 == null ? 0 : (Ipv4.GetHashCode()));
                hashcode = (hashcode * 397) ^ (Port == null ? 0 : (Port.GetHashCode()));
                hashcode = (hashcode * 397) ^ (Service_name == null ? 0 : (Service_name.GetHashCode()));
                hashcode = (hashcode * 397) ^ (Ipv6 == null ? 0 : (Ipv6.GetHashCode()));
            }
            return(hashcode);
        }
Beispiel #3
0
        public override int GetHashCode()
        {
            int h = 1;

            h *= 1000003;
            h ^= (ServiceName == null) ? 0 : ServiceName.GetHashCode();
            h *= 1000003;
            h ^= (Ipv4 == null) ? 0 : Ipv4.GetHashCode();
            h *= 1000003;
            h ^= (Ipv6 == null) ? 0 : Ipv6.GetHashCode();
            h *= 1000003;
            h ^= Port.GetHashCode();
            return(h);
        }
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if (__isset.ipv4)
                {
                    hashcode = (hashcode * 397) + Ipv4.GetHashCode();
                }
                if (__isset.port)
                {
                    hashcode = (hashcode * 397) + Port.GetHashCode();
                }
                if ((Service_name != null) && __isset.service_name)
                {
                    hashcode = (hashcode * 397) + Service_name.GetHashCode();
                }
                if ((Ipv6 != null) && __isset.ipv6)
                {
                    hashcode = (hashcode * 397) + Ipv6.GetHashCode();
                }
            }
            return(hashcode);
        }