예제 #1
0
        /// <summary>
        /// Returns true if PaymentCreationOutput instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentCreationOutput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentCreationOutput other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     IsNewToken == other.IsNewToken ||
                     IsNewToken != null &&
                     IsNewToken.Equals(other.IsNewToken)
                     ) &&
                 (
                     Token == other.Token ||
                     Token != null &&
                     Token.Equals(other.Token)
                 ) &&
                 (
                     TokenizationSucceeded == other.TokenizationSucceeded ||
                     TokenizationSucceeded != null &&
                     TokenizationSucceeded.Equals(other.TokenizationSucceeded)
                 ));
        }
예제 #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 (IsNewToken != null)
         {
             hashCode = hashCode * 59 + IsNewToken.GetHashCode();
         }
         if (Token != null)
         {
             hashCode = hashCode * 59 + Token.GetHashCode();
         }
         if (TokenizationSucceeded != null)
         {
             hashCode = hashCode * 59 + TokenizationSucceeded.GetHashCode();
         }
         return(hashCode);
     }
 }