Пример #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 (CurrentExecutable != null)
         {
             hashCode = hashCode * 59 + CurrentExecutable.GetHashCode();
         }
         if (Idle != null)
         {
             hashCode = hashCode * 59 + Idle.GetHashCode();
         }
         if (LikelyStuck != null)
         {
             hashCode = hashCode * 59 + LikelyStuck.GetHashCode();
         }
         if (Number != null)
         {
             hashCode = hashCode * 59 + Number.GetHashCode();
         }
         if (Progress != null)
         {
             hashCode = hashCode * 59 + Progress.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if HudsonMasterComputerexecutors instances are equal
        /// </summary>
        /// <param name="other">Instance of HudsonMasterComputerexecutors to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HudsonMasterComputerexecutors other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CurrentExecutable == other.CurrentExecutable ||
                     CurrentExecutable != null &&
                     CurrentExecutable.Equals(other.CurrentExecutable)
                     ) &&
                 (
                     Idle == other.Idle ||
                     Idle != null &&
                     Idle.Equals(other.Idle)
                 ) &&
                 (
                     LikelyStuck == other.LikelyStuck ||
                     LikelyStuck != null &&
                     LikelyStuck.Equals(other.LikelyStuck)
                 ) &&
                 (
                     Number == other.Number ||
                     Number != null &&
                     Number.Equals(other.Number)
                 ) &&
                 (
                     Progress == other.Progress ||
                     Progress != null &&
                     Progress.Equals(other.Progress)
                 ) &&
                 (
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                 ));
        }