Ejemplo n.º 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 (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Url != null)
         {
             hashCode = hashCode * 59 + Url.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (Actions != null)
         {
             hashCode = hashCode * 59 + Actions.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (DisplayName != null)
         {
             hashCode = hashCode * 59 + DisplayName.GetHashCode();
         }
         if (DisplayNameOrNull != null)
         {
             hashCode = hashCode * 59 + DisplayNameOrNull.GetHashCode();
         }
         if (FullDisplayName != null)
         {
             hashCode = hashCode * 59 + FullDisplayName.GetHashCode();
         }
         if (FullName != null)
         {
             hashCode = hashCode * 59 + FullName.GetHashCode();
         }
         if (Buildable != null)
         {
             hashCode = hashCode * 59 + Buildable.GetHashCode();
         }
         if (Builds != null)
         {
             hashCode = hashCode * 59 + Builds.GetHashCode();
         }
         if (FirstBuild != null)
         {
             hashCode = hashCode * 59 + FirstBuild.GetHashCode();
         }
         if (HealthReport != null)
         {
             hashCode = hashCode * 59 + HealthReport.GetHashCode();
         }
         if (InQueue != null)
         {
             hashCode = hashCode * 59 + InQueue.GetHashCode();
         }
         if (KeepDependencies != null)
         {
             hashCode = hashCode * 59 + KeepDependencies.GetHashCode();
         }
         if (LastBuild != null)
         {
             hashCode = hashCode * 59 + LastBuild.GetHashCode();
         }
         if (LastCompletedBuild != null)
         {
             hashCode = hashCode * 59 + LastCompletedBuild.GetHashCode();
         }
         if (LastFailedBuild != null)
         {
             hashCode = hashCode * 59 + LastFailedBuild.GetHashCode();
         }
         if (LastStableBuild != null)
         {
             hashCode = hashCode * 59 + LastStableBuild.GetHashCode();
         }
         if (LastSuccessfulBuild != null)
         {
             hashCode = hashCode * 59 + LastSuccessfulBuild.GetHashCode();
         }
         if (LastUnstableBuild != null)
         {
             hashCode = hashCode * 59 + LastUnstableBuild.GetHashCode();
         }
         if (LastUnsuccessfulBuild != null)
         {
             hashCode = hashCode * 59 + LastUnsuccessfulBuild.GetHashCode();
         }
         if (NextBuildNumber != null)
         {
             hashCode = hashCode * 59 + NextBuildNumber.GetHashCode();
         }
         if (QueueItem != null)
         {
             hashCode = hashCode * 59 + QueueItem.GetHashCode();
         }
         if (ConcurrentBuild != null)
         {
             hashCode = hashCode * 59 + ConcurrentBuild.GetHashCode();
         }
         if (Scm != null)
         {
             hashCode = hashCode * 59 + Scm.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if FreeStyleProject instances are equal
        /// </summary>
        /// <param name="other">Instance of FreeStyleProject to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(FreeStyleProject other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Url == other.Url ||
                     Url != null &&
                     Url.Equals(other.Url)
                 ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     Actions == other.Actions ||
                     Actions != null &&
                     Actions.SequenceEqual(other.Actions)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     DisplayName == other.DisplayName ||
                     DisplayName != null &&
                     DisplayName.Equals(other.DisplayName)
                 ) &&
                 (
                     DisplayNameOrNull == other.DisplayNameOrNull ||
                     DisplayNameOrNull != null &&
                     DisplayNameOrNull.Equals(other.DisplayNameOrNull)
                 ) &&
                 (
                     FullDisplayName == other.FullDisplayName ||
                     FullDisplayName != null &&
                     FullDisplayName.Equals(other.FullDisplayName)
                 ) &&
                 (
                     FullName == other.FullName ||
                     FullName != null &&
                     FullName.Equals(other.FullName)
                 ) &&
                 (
                     Buildable == other.Buildable ||
                     Buildable != null &&
                     Buildable.Equals(other.Buildable)
                 ) &&
                 (
                     Builds == other.Builds ||
                     Builds != null &&
                     Builds.SequenceEqual(other.Builds)
                 ) &&
                 (
                     FirstBuild == other.FirstBuild ||
                     FirstBuild != null &&
                     FirstBuild.Equals(other.FirstBuild)
                 ) &&
                 (
                     HealthReport == other.HealthReport ||
                     HealthReport != null &&
                     HealthReport.SequenceEqual(other.HealthReport)
                 ) &&
                 (
                     InQueue == other.InQueue ||
                     InQueue != null &&
                     InQueue.Equals(other.InQueue)
                 ) &&
                 (
                     KeepDependencies == other.KeepDependencies ||
                     KeepDependencies != null &&
                     KeepDependencies.Equals(other.KeepDependencies)
                 ) &&
                 (
                     LastBuild == other.LastBuild ||
                     LastBuild != null &&
                     LastBuild.Equals(other.LastBuild)
                 ) &&
                 (
                     LastCompletedBuild == other.LastCompletedBuild ||
                     LastCompletedBuild != null &&
                     LastCompletedBuild.Equals(other.LastCompletedBuild)
                 ) &&
                 (
                     LastFailedBuild == other.LastFailedBuild ||
                     LastFailedBuild != null &&
                     LastFailedBuild.Equals(other.LastFailedBuild)
                 ) &&
                 (
                     LastStableBuild == other.LastStableBuild ||
                     LastStableBuild != null &&
                     LastStableBuild.Equals(other.LastStableBuild)
                 ) &&
                 (
                     LastSuccessfulBuild == other.LastSuccessfulBuild ||
                     LastSuccessfulBuild != null &&
                     LastSuccessfulBuild.Equals(other.LastSuccessfulBuild)
                 ) &&
                 (
                     LastUnstableBuild == other.LastUnstableBuild ||
                     LastUnstableBuild != null &&
                     LastUnstableBuild.Equals(other.LastUnstableBuild)
                 ) &&
                 (
                     LastUnsuccessfulBuild == other.LastUnsuccessfulBuild ||
                     LastUnsuccessfulBuild != null &&
                     LastUnsuccessfulBuild.Equals(other.LastUnsuccessfulBuild)
                 ) &&
                 (
                     NextBuildNumber == other.NextBuildNumber ||
                     NextBuildNumber != null &&
                     NextBuildNumber.Equals(other.NextBuildNumber)
                 ) &&
                 (
                     QueueItem == other.QueueItem ||
                     QueueItem != null &&
                     QueueItem.Equals(other.QueueItem)
                 ) &&
                 (
                     ConcurrentBuild == other.ConcurrentBuild ||
                     ConcurrentBuild != null &&
                     ConcurrentBuild.Equals(other.ConcurrentBuild)
                 ) &&
                 (
                     Scm == other.Scm ||
                     Scm != null &&
                     Scm.Equals(other.Scm)
                 ));
        }