Example #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (BridgeUID != null)
         {
             hashCode = hashCode * 59 + BridgeUID.GetHashCode();
         }
         if (Configuration != null)
         {
             hashCode = hashCode * 59 + Configuration.GetHashCode();
         }
         if (Properties != null)
         {
             hashCode = hashCode * 59 + Properties.GetHashCode();
         }
         if (UID != null)
         {
             hashCode = hashCode * 59 + UID.GetHashCode();
         }
         if (ThingTypeUID != null)
         {
             hashCode = hashCode * 59 + ThingTypeUID.GetHashCode();
         }
         if (Channels != null)
         {
             hashCode = hashCode * 59 + Channels.GetHashCode();
         }
         if (Location != null)
         {
             hashCode = hashCode * 59 + Location.GetHashCode();
         }
         if (StatusInfo != null)
         {
             hashCode = hashCode * 59 + StatusInfo.GetHashCode();
         }
         if (FirmwareStatus != null)
         {
             hashCode = hashCode * 59 + FirmwareStatus.GetHashCode();
         }
         if (Editable != null)
         {
             hashCode = hashCode * 59 + Editable.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if ThingDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of ThingDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ThingDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                     ) &&
                 (
                     BridgeUID == input.BridgeUID ||
                     (BridgeUID != null &&
                      BridgeUID.Equals(input.BridgeUID))
                 ) &&
                 (
                     Configuration == input.Configuration ||
                     Configuration != null &&
                     Configuration.SequenceEqual(input.Configuration)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                 ) &&
                 (
                     ThingTypeUID == input.ThingTypeUID ||
                     (ThingTypeUID != null &&
                      ThingTypeUID.Equals(input.ThingTypeUID))
                 ) &&
                 (
                     Channels == input.Channels ||
                     Channels != null &&
                     Channels.SequenceEqual(input.Channels)
                 ) &&
                 (
                     Location == input.Location ||
                     (Location != null &&
                      Location.Equals(input.Location))
                 ));
        }
Example #3
0
        /// <summary>
        /// Returns true if DiscoveryResultDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of DiscoveryResultDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DiscoveryResultDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     BridgeUID == input.BridgeUID ||
                     (BridgeUID != null &&
                      BridgeUID.Equals(input.BridgeUID))
                     ) &&
                 (
                     Flag == input.Flag ||
                     (Flag != null &&
                      Flag.Equals(input.Flag))
                 ) &&
                 (
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     RepresentationProperty == input.RepresentationProperty ||
                     (RepresentationProperty != null &&
                      RepresentationProperty.Equals(input.RepresentationProperty))
                 ) &&
                 (
                     ThingUID == input.ThingUID ||
                     (ThingUID != null &&
                      ThingUID.Equals(input.ThingUID))
                 ) &&
                 (
                     ThingTypeUID == input.ThingTypeUID ||
                     (ThingTypeUID != null &&
                      ThingTypeUID.Equals(input.ThingTypeUID))
                 ));
        }
Example #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (BridgeUID != null)
         {
             hashCode = hashCode * 59 + BridgeUID.GetHashCode();
         }
         if (Flag != null)
         {
             hashCode = hashCode * 59 + Flag.GetHashCode();
         }
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (Properties != null)
         {
             hashCode = hashCode * 59 + Properties.GetHashCode();
         }
         if (RepresentationProperty != null)
         {
             hashCode = hashCode * 59 + RepresentationProperty.GetHashCode();
         }
         if (ThingUID != null)
         {
             hashCode = hashCode * 59 + ThingUID.GetHashCode();
         }
         if (ThingTypeUID != null)
         {
             hashCode = hashCode * 59 + ThingTypeUID.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #5
0
        /// <summary>
        /// Returns true if EnrichedThingDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of EnrichedThingDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EnrichedThingDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                     ) &&
                 (
                     BridgeUID == input.BridgeUID ||
                     (BridgeUID != null &&
                      BridgeUID.Equals(input.BridgeUID))
                 ) &&
                 (
                     Configuration == input.Configuration ||
                     Configuration != null &&
                     Configuration.SequenceEqual(input.Configuration)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                 ) &&
                 (
                     ThingTypeUID == input.ThingTypeUID ||
                     (ThingTypeUID != null &&
                      ThingTypeUID.Equals(input.ThingTypeUID))
                 ) &&
                 (
                     Channels == input.Channels ||
                     Channels != null &&
                     Channels.SequenceEqual(input.Channels)
                 ) &&
                 (
                     Location == input.Location ||
                     (Location != null &&
                      Location.Equals(input.Location))
                 ) &&
                 (
                     StatusInfo == input.StatusInfo ||
                     (StatusInfo != null &&
                      StatusInfo.Equals(input.StatusInfo))
                 ) &&
                 (
                     FirmwareStatus == input.FirmwareStatus ||
                     (FirmwareStatus != null &&
                      FirmwareStatus.Equals(input.FirmwareStatus))
                 ) &&
                 (
                     Editable == input.Editable ||
                     (Editable != null &&
                      Editable.Equals(input.Editable))
                 ));
        }