Skip to content

Commit 2f7e64d

Browse files
added equals to Account, and comments to rule class
1 parent 0b89200 commit 2f7e64d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/main/java/com/diffblue/corebanking/account/Account.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ public enum AccountState {
193193
CLOSED
194194
}
195195

196+
@Override
197+
public boolean equals(Object o) {
198+
if (this == o) return true;
199+
if (o == null) return false;
200+
if (!(o instanceof Account)) return false;
201+
Account account = (Account) o;
202+
return accountNumber == account.accountNumber;
203+
}
204+
196205
/** AccountStatement of an account, which holds the list of all executed transactions. */
197206
public class AccountStatement {
198207
private final List<Transaction> transactions;

src/main/java/com/diffblue/corebanking/compliance/rules/ComplianceRuleLargeBalance.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@
33
import com.diffblue.corebanking.account.Account;
44

55
public class ComplianceRuleLargeBalance extends ComplianceRule {
6+
7+
/**
8+
* The maximum balance an account can have before it becomes non-compliant.
9+
*/
610
public static final long MAX_ACCOUNT_VALUE = 100000;
711

12+
/**
13+
* Checks if the passed account passes or fails this rule.
14+
*
15+
* @param account The account to verify compliance.
16+
*/
817
@Override
918
public void validateAccountCompliance(final Account account) {
19+
20+
// Make sure the account does not belong to any list.
21+
//this.forgetAccount(account);
22+
1023
if (account == null) {
1124
throw new IllegalArgumentException();
1225
}

0 commit comments

Comments
 (0)