/// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(AuthorizationStatus.GetHashCode() * 23 ^
                       GeoCoordinates.GetHashCode() * 19 ^

                       (ChargingStationName != null
                           ? ChargingStationName.GetHashCode() * 17
                           : 0) ^

                       (Address != null
                           ? Address.GetHashCode() * 13
                           : 0) ^

                       (SessionId.HasValue
                           ? SessionId.Value.GetHashCode() * 11
                           : 0) ^

                       (StatusCode != null
                           ? StatusCode.GetHashCode() * 7
                           : 0) ^

                       (TermsOfUse != null
                           ? TermsOfUse.GetHashCode() * 5
                           : 0) ^

                       (AdditionalInfo != null
                           ? AdditionalInfo.GetHashCode() * 3
                           : 0));
            }
        }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (m_ObjPropertyCollection != null ? m_ObjPropertyCollection.GetHashCode() : 0);
         result = (result * 397) ^ (CharacterSet != null ? CharacterSet.GetHashCode() : 0);
         result = (result * 397) ^ (ContentEncoding != null ? ContentEncoding.GetHashCode() : 0);
         result = (result * 397) ^ (ContentType != null ? ContentType.GetHashCode() : 0);
         result = (result * 397) ^ (Headers != null ? Headers.GetHashCode() : 0);
         result = (result * 397) ^ IsFromCache.GetHashCode();
         result = (result * 397) ^ IsMutuallyAuthenticated.GetHashCode();
         result = (result * 397) ^ LastModified.GetHashCode();
         result = (result * 397) ^ (Method != null ? Method.GetHashCode() : 0);
         result = (result * 397) ^ (OriginalReferrerUrl != null ? OriginalReferrerUrl.GetHashCode() : 0);
         result = (result * 397) ^ (OriginalUrl != null ? OriginalUrl.GetHashCode() : 0);
         result = (result * 397) ^ (ProtocolVersion != null ? ProtocolVersion.GetHashCode() : 0);
         result = (result * 397) ^ (Referrer != null ? Referrer.GetHashCode() : 0);
         result = (result * 397) ^ (ResponseUri != null ? ResponseUri.GetHashCode() : 0);
         result = (result * 397) ^ (Server != null ? Server.GetHashCode() : 0);
         result = (result * 397) ^ StatusCode.GetHashCode();
         result = (result * 397) ^ (StatusDescription != null ? StatusDescription.GetHashCode() : 0);
         result = (result * 397) ^ (Step != null ? Step.GetHashCode() : 0);
         result = (result * 397) ^ (Text != null ? Text.GetHashCode() : 0);
         result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         result = (result * 397) ^ DownloadTime.GetHashCode();
         return(result);
     }
 }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                hashcode = (hashcode * 397) + StatusCode.GetHashCode();
                if (__isset.infoMessages)
                {
                    hashcode = (hashcode * 397) + TCollections.GetHashCode(InfoMessages);
                }
                if (__isset.sqlState)
                {
                    hashcode = (hashcode * 397) + SqlState.GetHashCode();
                }
                if (__isset.errorCode)
                {
                    hashcode = (hashcode * 397) + ErrorCode.GetHashCode();
                }
                if (__isset.errorMessage)
                {
                    hashcode = (hashcode * 397) + ErrorMessage.GetHashCode();
                }
            }
            return(hashcode);
        }
Exemplo n.º 4
0
        private string GetStatusLine(StatusCode code)
        {
            string statusLine = "";
            int    codeNum    = code.GetHashCode();

            if (codeNum == 200)
            {
                statusLine = Configuration.ServerHTTPVersion + ' ' + codeNum + ' ' + "OK";
            }
            else if (codeNum == 500)
            {
                statusLine = Configuration.ServerHTTPVersion + ' ' + codeNum + ' ' + "Internal Server Error";
            }
            else if (codeNum == 404)
            {
                statusLine = Configuration.ServerHTTPVersion + ' ' + codeNum + ' ' + "Not Found";
            }
            else if (codeNum == 400)
            {
                statusLine = Configuration.ServerHTTPVersion + ' ' + codeNum + ' ' + "Bad Request";
            }
            else if (codeNum == 301)
            {
                statusLine = Configuration.ServerHTTPVersion + ' ' + codeNum + ' ' + "Redirect";
            }

            return(statusLine);
        }
Exemplo n.º 5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            if (ApiUrl.Length != 0)
            {
                hash ^= ApiUrl.GetHashCode();
            }
            hash ^= platformReturns_.GetHashCode();
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            hash ^= returns_.GetHashCode();
            if (Error.Length != 0)
            {
                hash ^= Error.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StatusCode.GetHashCode();
         hashCode = (hashCode * 397) ^ (Message != null ? Message.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ EventId.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 7
0
        public void GetEnumValue_EnumName_ReturnCorrespondEnumValue()
        {
            //Arrange
            StatusCode statusCode = StatusCode.Disable;

            //Act
            string actual = statusCode.ToString();

            //Assert
            Assert.Equal(statusCode.GetHashCode(), actual.GetEnumValue <StatusCode>());
        }
Exemplo n.º 8
0
        public void GetEnum_EnumValue_ReturnCorrespondEnum()
        {
            //Arrange
            StatusCode statusCode = StatusCode.Disable;

            //Act
            int actual = statusCode.GetHashCode();

            //Assert
            Assert.Equal(statusCode, actual.GetEnum <StatusCode>());
        }
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StatusCode.GetHashCode();
         hashCode = (hashCode * 397) ^ (Delay != null ? Delay.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ConnectionOptions != null ? ConnectionOptions.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Body != null ? Body.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Headers != null ? Headers.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 10
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (Count != 0L)
            {
                hash ^= Count.GetHashCode();
            }
            return(hash);
        }
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Op != null)
                {
                    hash = hash * 59 + Op.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (ErrorMessage != null)
                {
                    hash = hash * 59 + ErrorMessage.GetHashCode();
                }

                if (ErrorCode != null)
                {
                    hash = hash * 59 + ErrorCode.GetHashCode();
                }

                if (ConnectionId != null)
                {
                    hash = hash * 59 + ConnectionId.GetHashCode();
                }

                if (ConnectionClosed != null)
                {
                    hash = hash * 59 + ConnectionClosed.GetHashCode();
                }

                if (StatusCode != null)
                {
                    hash = hash * 59 + StatusCode.GetHashCode();
                }

                return(hash);
            }
        }
Exemplo n.º 12
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (Detail.Length != 0)
            {
                hash ^= Detail.GetHashCode();
            }
            if (Message.Length != 0)
            {
                hash ^= Message.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            hash ^= requests_.GetHashCode();
            hash ^= platformRequests_.GetHashCode();
            if (Latitude != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Latitude);
            }
            if (Longitude != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Longitude);
            }
            if (Accuracy != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Accuracy);
            }
            if (authInfo_ != null)
            {
                hash ^= AuthInfo.GetHashCode();
            }
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            if (MsSinceLastLocationfix != 0L)
            {
                hash ^= MsSinceLastLocationfix.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            hash ^= requests_.GetHashCode();
            if (unknown6_ != null)
            {
                hash ^= Unknown6.GetHashCode();
            }
            if (Latitude != 0D)
            {
                hash ^= Latitude.GetHashCode();
            }
            if (Longitude != 0D)
            {
                hash ^= Longitude.GetHashCode();
            }
            if (Altitude != 0D)
            {
                hash ^= Altitude.GetHashCode();
            }
            if (authInfo_ != null)
            {
                hash ^= AuthInfo.GetHashCode();
            }
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            if (Unknown12 != 0L)
            {
                hash ^= Unknown12.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 15
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            hash ^= requests_.GetHashCode();
            if (unknown6_ != null)
            {
                hash ^= Unknown6.GetHashCode();
            }
            if (Latitude != 0D)
            {
                hash ^= Latitude.GetHashCode();
            }
            if (Longitude != 0D)
            {
                hash ^= Longitude.GetHashCode();
            }
            if (Accuracy != 0D)
            {
                hash ^= Accuracy.GetHashCode();
            }
            if (authInfo_ != null)
            {
                hash ^= AuthInfo.GetHashCode();
            }
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            if (MsSinceLastLocationfix != 0L)
            {
                hash ^= MsSinceLastLocationfix.GetHashCode();
            }
            return(hash);
        }
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (StatusCode != 0)
                    {
                        hash ^= StatusCode.GetHashCode();
                    }
                    hash ^= Headers.GetHashCode();
                    if (Body.Length != 0)
                    {
                        hash ^= Body.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
Exemplo n.º 17
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (StatusErrorMessage.Length != 0)
            {
                hash ^= StatusErrorMessage.GetHashCode();
            }
            hash ^= hloProtos_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 18
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (HasUri)
            {
                hash ^= Uri.GetHashCode();
            }
            if (HasExpiry)
            {
                hash ^= Expiry.GetHashCode();
            }
            if (HasStatusCode)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 19
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (RequestPath?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Message?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RequestId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RequestMethod?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ElapsedMsecs?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IP?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Service?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Operation?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (StatusCode?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Timestamp?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Username?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RequestUri?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ClientId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ClientName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ProductName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RequestLogKey?.GetHashCode() ?? 0);
            return(hashCode);
        }
Exemplo n.º 20
0
 public override int GetHashCode()
 {
     return(StatusCode.GetHashCode());
 }
Exemplo n.º 21
0
 /// <summary>
 /// Returns the hashcode of this Object
 /// </summary>
 /// <returns>Hash code (int)</returns>
 public override int GetHashCode()
 {
     // Credit: http://stackoverflow.com/a/263416/677735
     unchecked             // Overflow is fine, just wrap
     {
         int hash = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hash = hash * 59 + Id.GetHashCode();
         }
         if (LogMessageTypeId != null)
         {
             hash = hash * 59 + LogMessageTypeId.GetHashCode();
         }
         if (ApplicationName != null)
         {
             hash = hash * 59 + ApplicationName.GetHashCode();
         }
         if (ApplicationMethod != null)
         {
             hash = hash * 59 + ApplicationMethod.GetHashCode();
         }
         if (IpAddress != null)
         {
             hash = hash * 59 + IpAddress.GetHashCode();
         }
         if (LoginToken != null)
         {
             hash = hash * 59 + LoginToken.GetHashCode();
         }
         if (ShortMessage != null)
         {
             hash = hash * 59 + ShortMessage.GetHashCode();
         }
         if (RequestHttpMethod != null)
         {
             hash = hash * 59 + RequestHttpMethod.GetHashCode();
         }
         if (RequestUri != null)
         {
             hash = hash * 59 + RequestUri.GetHashCode();
         }
         if (RequestParams != null)
         {
             hash = hash * 59 + RequestParams.GetHashCode();
         }
         if (RequestBody != null)
         {
             hash = hash * 59 + RequestBody.GetHashCode();
         }
         if (StatusCode != null)
         {
             hash = hash * 59 + StatusCode.GetHashCode();
         }
         if (ResponseContent != null)
         {
             hash = hash * 59 + ResponseContent.GetHashCode();
         }
         if (FullMessage != null)
         {
             hash = hash * 59 + FullMessage.GetHashCode();
         }
         if (Exception != null)
         {
             hash = hash * 59 + Exception.GetHashCode();
         }
         if (Trace != null)
         {
             hash = hash * 59 + Trace.GetHashCode();
         }
         if (Logged != null)
         {
             hash = hash * 59 + Logged.GetHashCode();
         }
         return(hash);
     }
 }
Exemplo n.º 22
0
 /// <summary>
 /// 根据错误枚举
 /// 返回异常
 /// </summary>
 /// <param name="code">错误枚举</param>
 /// <returns></returns>
 public static ApiRestModel <T> False <T>(StatusCode code) where T : class
 {
     return(False(code.GetHashCode(), code.GetFieldDescription(), default(T)));
 }
Exemplo n.º 23
0
 public override int GetHashCode()
 {
     return(-763886418 + StatusCode.GetHashCode());
 }
Exemplo n.º 24
0
 public override int GetHashCode()
 {
     return(StatusCode != null ? StatusCode.GetHashCode() : 0);
 }