Exemplo 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 (Links != null)
         {
             hashCode = hashCode * 59 + Links.GetHashCode();
         }
         if (JenkinsOrganizationPipeline != null)
         {
             hashCode = hashCode * 59 + JenkinsOrganizationPipeline.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if GithubOrganization instances are equal
        /// </summary>
        /// <param name="other">Instance of GithubOrganization to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GithubOrganization other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     Links == other.Links ||
                     Links != null &&
                     Links.Equals(other.Links)
                 ) &&
                 (
                     JenkinsOrganizationPipeline == other.JenkinsOrganizationPipeline ||
                     JenkinsOrganizationPipeline != null &&
                     JenkinsOrganizationPipeline.Equals(other.JenkinsOrganizationPipeline)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ));
        }