Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LastBalance.cs
1using System;
4
5namespace EDaler
6{
10 [TypeName(TypeNameSerialization.FullName)]
11 public class LastBalance
12 {
13 private DateTime timestamp = DateTime.MinValue;
15 private decimal balance = 0;
16 private PendingPayment[] pending = null;
17
21 public LastBalance()
22 {
23 }
24
28 public DateTime Timestamp
29 {
30 get => this.timestamp;
31 set => this.timestamp = value;
32 }
33
38 {
39 get => this.currency;
40 set => this.currency = value;
41 }
42
46 public decimal Balance
47 {
48 get => this.balance;
49 set => this.balance = value;
50 }
51
56 {
57 get => this.pending;
58 set => this.pending = value;
59 }
60
64 public override bool Equals(object obj)
65 {
66 if (!(obj is LastBalance O))
67 return false;
68
69 if (this.timestamp != O.timestamp ||
70 this.currency != O.currency ||
71 this.balance != O.balance ||
72 ((this.pending is null) ^ (O.pending is null)))
73 {
74 return false;
75 }
76
77 if (!(this.pending is null))
78 {
79 int i, c = this.pending.Length;
80 if (c != O.pending.Length)
81 return false;
82
83 for (i = 0; i < c; i++)
84 {
85 if (!this.pending[i].Equals(O.pending[i]))
86 return false;
87 }
88 }
89
90 return true;
91 }
92
96 public override int GetHashCode()
97 {
98 int Result = this.timestamp.GetHashCode();
99 Result ^= Result << 5 ^ this.currency.GetHashCode();
100 Result ^= Result << 5 ^ this.balance.GetHashCode();
101
102 if (!(this.pending is null))
103 {
104 foreach (PendingPayment Pending in this.pending)
105 Result ^= Result << 5 ^ Pending.GetHashCode();
106 }
107
108 return Result;
109 }
110 }
111}
Contains information about a balance.
Definition: Balance.cs:11
Information about last balance statement
Definition: LastBalance.cs:12
CaseInsensitiveString Currency
Balance Currency
Definition: LastBalance.cs:38
PendingPayment[] Pending
Pending payments
Definition: LastBalance.cs:56
LastBalance()
Information about last balance statement
Definition: LastBalance.cs:21
DateTime Timestamp
Balance timestamp
Definition: LastBalance.cs:29
override bool Equals(object obj)
Object.Equals(object)
Definition: LastBalance.cs:64
override int GetHashCode()
Object.GetHashCode()
Definition: LastBalance.cs:96
Contains information about a pending payment.
override int GetHashCode()
Object.GetHashCode()
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
override int GetHashCode()
Returns the hash code for this string.
TypeNameSerialization
How the type name should be serialized.