Esempio n. 1
0
        /// <summary>
        /// Returns true if Endpoint instances are equal
        /// </summary>
        /// <param name="other">Instance of Endpoint to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Endpoint other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ServiceName == other.ServiceName ||
                     ServiceName != null &&
                     ServiceName.Equals(other.ServiceName)
                     ) &&
                 (
                     Ipv4 == other.Ipv4 ||
                     Ipv4 != null &&
                     Ipv4.Equals(other.Ipv4)
                 ) &&
                 (
                     Ipv6 == other.Ipv6 ||
                     Ipv6 != null &&
                     Ipv6.Equals(other.Ipv6)
                 ) &&
                 (
                     Port == other.Port ||
                     Port != null &&
                     Port.Equals(other.Port)
                 ));
        }
Esempio n. 2
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }

            if (!(o is ZipkinEndpoint))
            {
                return(false);
            }

            ZipkinEndpoint that = (ZipkinEndpoint)o;

            return(((ServiceName == null)
              ? (that.ServiceName == null) : ServiceName.Equals(that.ServiceName)) &&
                   ((Ipv4 == null) ? (that.Ipv4 == null) : Ipv4.Equals(that.Ipv4)) &&
                   ((Ipv6 == null) ? (that.Ipv6 == null) : Ipv6.Equals(that.Ipv6)) &&
                   Port.Equals(that.Port));
        }