Beispiel #1
0
        public int CompareTo(Node?other)
        {
            if (other == null || other.GetType() != typeof(Node))
            {
                return(1);
            }

            var result = Id.CompareTo(other.Id);

            if (result != 0)
            {
                return(result);
            }

            result = Name.CompareTo(other.Name);
            if (result != 0)
            {
                return(result);
            }

            result = OperationalAddress.CompareTo(other.OperationalAddress);
            if (result != 0)
            {
                return(result);
            }

            result = ApplicationAddress.CompareTo(other.ApplicationAddress);
            if (result != 0)
            {
                return(result);
            }

            return(0);
        }
Beispiel #2
0
        public override bool Equals(object?obj)
        {
            if (obj == null || obj.GetType() != typeof(Node))
            {
                return(false);
            }

            var node = (Node)obj;

            return
                (Id.Equals(node.Id) &&
                 Name.Equals(node.Name) &&
                 OperationalAddress.Equals(node.OperationalAddress) &&
                 ApplicationAddress.Equals(node.ApplicationAddress));
        }
Beispiel #3
0
 public override int GetHashCode() => 31 *(Id.GetHashCode() + Name.GetHashCode() + OperationalAddress.GetHashCode() + ApplicationAddress.GetHashCode());