示例#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 (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                hashCode = hashCode * 59 + Type.GetHashCode();
                if (RepositoryId != null)
                {
                    hashCode = hashCode * 59 + RepositoryId.GetHashCode();
                }
                if (Branch != null)
                {
                    hashCode = hashCode * 59 + Branch.GetHashCode();
                }
                if (EnvironmentId != null)
                {
                    hashCode = hashCode * 59 + EnvironmentId.GetHashCode();
                }
                return(hashCode);
            }
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (RepositoryId.Length != 0)
            {
                hash ^= RepositoryId.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (Status != global::Yandex.Cloud.Containerregistry.V1.LifecyclePolicy.Types.Status.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            hash ^= rules_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#3
0
        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            int cName = ConnectorName == null ? 0 : ConnectorName.GetHashCode();
            int rUri  = RepositoryUri == null ? 0 : RepositoryUri.GetHashCode();
            int rId   = RepositoryId == null ? 0 : RepositoryId.GetHashCode();

            return(cName ^ rUri ^ rId);
        }
示例#4
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 (ProgramId != null)
                {
                    hashCode = hashCode * 59 + ProgramId.GetHashCode();
                }

                hashCode = hashCode * 59 + RepositoryId.GetHashCode();
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (Links != null)
                {
                    hashCode = hashCode * 59 + Links.GetHashCode();
                }
                return(hashCode);
            }
        }