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

                hashCode = hashCode * 59 + State.GetHashCode();
                if (ReceivedTimestamp != null)
                {
                    hashCode = hashCode * 59 + ReceivedTimestamp.GetHashCode();
                }

                hashCode = hashCode * 59 + Currency.GetHashCode();
                if (Address != null)
                {
                    hashCode = hashCode * 59 + Address.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (TransactionId != null)
                {
                    hashCode = hashCode * 59 + TransactionId.GetHashCode();
                }
                return(hashCode);
            }
        }
        /// <summary>
        /// Returns true if TransferItem instances are equal
        /// </summary>
        /// <param name="other">Instance of TransferItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TransferItem other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UpdatedTimestamp == other.UpdatedTimestamp ||
                     UpdatedTimestamp != null &&
                     UpdatedTimestamp.Equals(other.UpdatedTimestamp)
                     ) &&
                 (
                     Direction == other.Direction ||

                     Direction.Equals(other.Direction)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     OtherSide == other.OtherSide ||
                     OtherSide != null &&
                     OtherSide.Equals(other.OtherSide)
                 ) &&
                 (
                     Currency == other.Currency ||

                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     State == other.State ||

                     State.Equals(other.State)
                 ) &&
                 (
                     CreatedTimestamp == other.CreatedTimestamp ||
                     CreatedTimestamp != null &&
                     CreatedTimestamp.Equals(other.CreatedTimestamp)
                 ) &&
                 (
                     Type == other.Type ||

                     Type.Equals(other.Type)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ));
        }
Exemple #3
0
        /// <summary>
        /// Returns true if Deposit instances are equal
        /// </summary>
        /// <param name="other">Instance of Deposit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Deposit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UpdatedTimestamp == other.UpdatedTimestamp ||
                     UpdatedTimestamp != null &&
                     UpdatedTimestamp.Equals(other.UpdatedTimestamp)
                     ) &&
                 (
                     State == other.State ||

                     State.Equals(other.State)
                 ) &&
                 (
                     ReceivedTimestamp == other.ReceivedTimestamp ||
                     ReceivedTimestamp != null &&
                     ReceivedTimestamp.Equals(other.ReceivedTimestamp)
                 ) &&
                 (
                     Currency == other.Currency ||

                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     TransactionId == other.TransactionId ||
                     TransactionId != null &&
                     TransactionId.Equals(other.TransactionId)
                 ));
        }
        /// <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 (UpdatedTimestamp != null)
                {
                    hashCode = hashCode * 59 + UpdatedTimestamp.GetHashCode();
                }

                hashCode = hashCode * 59 + Direction.GetHashCode();
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (OtherSide != null)
                {
                    hashCode = hashCode * 59 + OtherSide.GetHashCode();
                }

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

                hashCode = hashCode * 59 + State.GetHashCode();
                if (CreatedTimestamp != null)
                {
                    hashCode = hashCode * 59 + CreatedTimestamp.GetHashCode();
                }

                hashCode = hashCode * 59 + Type.GetHashCode();
                if (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }
                return(hashCode);
            }
        }
        /// <summary>
        /// Returns true if Withdrawal instances are equal
        /// </summary>
        /// <param name="other">Instance of Withdrawal to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Withdrawal other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UpdatedTimestamp == other.UpdatedTimestamp ||
                     UpdatedTimestamp != null &&
                     UpdatedTimestamp.Equals(other.UpdatedTimestamp)
                     ) &&
                 (
                     Fee == other.Fee ||
                     Fee != null &&
                     Fee.Equals(other.Fee)
                 ) &&
                 (
                     ConfirmedTimestamp == other.ConfirmedTimestamp ||
                     ConfirmedTimestamp != null &&
                     ConfirmedTimestamp.Equals(other.ConfirmedTimestamp)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     Priority == other.Priority ||
                     Priority != null &&
                     Priority.Equals(other.Priority)
                 ) &&
                 (
                     Currency == other.Currency ||

                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     State == other.State ||

                     State.Equals(other.State)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ) &&
                 (
                     CreatedTimestamp == other.CreatedTimestamp ||
                     CreatedTimestamp != null &&
                     CreatedTimestamp.Equals(other.CreatedTimestamp)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     TransactionId == other.TransactionId ||
                     TransactionId != null &&
                     TransactionId.Equals(other.TransactionId)
                 ));
        }