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 (AssignedLabels != null)
                {
                    hashCode = hashCode * 59 + AssignedLabels.GetHashCode();
                }
                if (Mode != null)
                {
                    hashCode = hashCode * 59 + Mode.GetHashCode();
                }
                if (NodeDescription != null)
                {
                    hashCode = hashCode * 59 + NodeDescription.GetHashCode();
                }
                if (NodeName != null)
                {
                    hashCode = hashCode * 59 + NodeName.GetHashCode();
                }

                hashCode = hashCode * 59 + NumExecutors.GetHashCode();
                if (Description != null)
                {
                    hashCode = hashCode * 59 + Description.GetHashCode();
                }
                if (Jobs != null)
                {
                    hashCode = hashCode * 59 + Jobs.GetHashCode();
                }
                if (PrimaryView != null)
                {
                    hashCode = hashCode * 59 + PrimaryView.GetHashCode();
                }

                hashCode = hashCode * 59 + QuietingDown.GetHashCode();

                hashCode = hashCode * 59 + SlaveAgentPort.GetHashCode();
                if (UnlabeledLoad != null)
                {
                    hashCode = hashCode * 59 + UnlabeledLoad.GetHashCode();
                }

                hashCode = hashCode * 59 + UseCrumbs.GetHashCode();

                hashCode = hashCode * 59 + UseSecurity.GetHashCode();
                if (Views != null)
                {
                    hashCode = hashCode * 59 + Views.GetHashCode();
                }
                return(hashCode);
            }
        }
Ejemplo n.º 2
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 (DisplayName != null)
                {
                    hashCode = hashCode * 59 + DisplayName.GetHashCode();
                }
                if (Executors != null)
                {
                    hashCode = hashCode * 59 + Executors.GetHashCode();
                }
                if (Icon != null)
                {
                    hashCode = hashCode * 59 + Icon.GetHashCode();
                }
                if (IconClassName != null)
                {
                    hashCode = hashCode * 59 + IconClassName.GetHashCode();
                }

                hashCode = hashCode * 59 + Idle.GetHashCode();

                hashCode = hashCode * 59 + JnlpAgent.GetHashCode();

                hashCode = hashCode * 59 + LaunchSupported.GetHashCode();
                if (LoadStatistics != null)
                {
                    hashCode = hashCode * 59 + LoadStatistics.GetHashCode();
                }

                hashCode = hashCode * 59 + ManualLaunchAllowed.GetHashCode();
                if (MonitorData != null)
                {
                    hashCode = hashCode * 59 + MonitorData.GetHashCode();
                }

                hashCode = hashCode * 59 + NumExecutors.GetHashCode();

                hashCode = hashCode * 59 + Offline.GetHashCode();
                if (OfflineCause != null)
                {
                    hashCode = hashCode * 59 + OfflineCause.GetHashCode();
                }
                if (OfflineCauseReason != null)
                {
                    hashCode = hashCode * 59 + OfflineCauseReason.GetHashCode();
                }

                hashCode = hashCode * 59 + TemporarilyOffline.GetHashCode();
                return(hashCode);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if HudsonMasterComputer instances are equal
        /// </summary>
        /// <param name="other">Instance of HudsonMasterComputer to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HudsonMasterComputer other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     DisplayName == other.DisplayName ||
                     DisplayName != null &&
                     DisplayName.Equals(other.DisplayName)
                 ) &&
                 (
                     Executors == other.Executors ||
                     Executors != null &&
                     Executors.SequenceEqual(other.Executors)
                 ) &&
                 (
                     Icon == other.Icon ||
                     Icon != null &&
                     Icon.Equals(other.Icon)
                 ) &&
                 (
                     IconClassName == other.IconClassName ||
                     IconClassName != null &&
                     IconClassName.Equals(other.IconClassName)
                 ) &&
                 (
                     Idle == other.Idle ||
                     Idle != null &&
                     Idle.Equals(other.Idle)
                 ) &&
                 (
                     JnlpAgent == other.JnlpAgent ||
                     JnlpAgent != null &&
                     JnlpAgent.Equals(other.JnlpAgent)
                 ) &&
                 (
                     LaunchSupported == other.LaunchSupported ||
                     LaunchSupported != null &&
                     LaunchSupported.Equals(other.LaunchSupported)
                 ) &&
                 (
                     LoadStatistics == other.LoadStatistics ||
                     LoadStatistics != null &&
                     LoadStatistics.Equals(other.LoadStatistics)
                 ) &&
                 (
                     ManualLaunchAllowed == other.ManualLaunchAllowed ||
                     ManualLaunchAllowed != null &&
                     ManualLaunchAllowed.Equals(other.ManualLaunchAllowed)
                 ) &&
                 (
                     MonitorData == other.MonitorData ||
                     MonitorData != null &&
                     MonitorData.Equals(other.MonitorData)
                 ) &&
                 (
                     NumExecutors == other.NumExecutors ||
                     NumExecutors != null &&
                     NumExecutors.Equals(other.NumExecutors)
                 ) &&
                 (
                     Offline == other.Offline ||
                     Offline != null &&
                     Offline.Equals(other.Offline)
                 ) &&
                 (
                     OfflineCause == other.OfflineCause ||
                     OfflineCause != null &&
                     OfflineCause.Equals(other.OfflineCause)
                 ) &&
                 (
                     OfflineCauseReason == other.OfflineCauseReason ||
                     OfflineCauseReason != null &&
                     OfflineCauseReason.Equals(other.OfflineCauseReason)
                 ) &&
                 (
                     TemporarilyOffline == other.TemporarilyOffline ||
                     TemporarilyOffline != null &&
                     TemporarilyOffline.Equals(other.TemporarilyOffline)
                 ));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns true if Hudson instances are equal
        /// </summary>
        /// <param name="other">Instance of Hudson to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Hudson other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     AssignedLabels == other.AssignedLabels ||
                     AssignedLabels != null &&
                     other.AssignedLabels != null &&
                     AssignedLabels.SequenceEqual(other.AssignedLabels)
                 ) &&
                 (
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                 ) &&
                 (
                     NodeDescription == other.NodeDescription ||
                     NodeDescription != null &&
                     NodeDescription.Equals(other.NodeDescription)
                 ) &&
                 (
                     NodeName == other.NodeName ||
                     NodeName != null &&
                     NodeName.Equals(other.NodeName)
                 ) &&
                 (
                     NumExecutors == other.NumExecutors ||

                     NumExecutors.Equals(other.NumExecutors)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Jobs == other.Jobs ||
                     Jobs != null &&
                     other.Jobs != null &&
                     Jobs.SequenceEqual(other.Jobs)
                 ) &&
                 (
                     PrimaryView == other.PrimaryView ||
                     PrimaryView != null &&
                     PrimaryView.Equals(other.PrimaryView)
                 ) &&
                 (
                     QuietingDown == other.QuietingDown ||

                     QuietingDown.Equals(other.QuietingDown)
                 ) &&
                 (
                     SlaveAgentPort == other.SlaveAgentPort ||

                     SlaveAgentPort.Equals(other.SlaveAgentPort)
                 ) &&
                 (
                     UnlabeledLoad == other.UnlabeledLoad ||
                     UnlabeledLoad != null &&
                     UnlabeledLoad.Equals(other.UnlabeledLoad)
                 ) &&
                 (
                     UseCrumbs == other.UseCrumbs ||

                     UseCrumbs.Equals(other.UseCrumbs)
                 ) &&
                 (
                     UseSecurity == other.UseSecurity ||

                     UseSecurity.Equals(other.UseSecurity)
                 ) &&
                 (
                     Views == other.Views ||
                     Views != null &&
                     other.Views != null &&
                     Views.SequenceEqual(other.Views)
                 ));
        }