Class Account
java.lang.Object
com.dada.banking_project.models.Accounts.Account
- Direct Known Subclasses:
CheckingAccount
,CreditCardAccount
,SavingAccount
This class represents a generic account.
-
Constructor Summary
ConstructorDescriptionAccount()
Account
(String primaryOwner, AccountHolder accountHolder) Account
(BigDecimal balance, String primaryOwner, String status, AccountHolder accountHolder) Account
(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkBalance
(BigDecimal amount) Checks whether the account has sufficient balance to make a transaction.boolean
checkOwnerName
(String name) Checks whether the provided name matches either the primary or secondary account owner name.void
-
Constructor Details
-
Account
public Account() -
Account
public Account(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) -
Account
-
Account
-
-
Method Details
-
setSecretKey
public void setSecretKey() -
checkBalance
Checks whether the account has sufficient balance to make a transaction.- Parameters:
amount
- The amount to check against the account balance.- Returns:
- true if the account has sufficient balance, false otherwise.
-
checkOwnerName
Checks whether the provided name matches either the primary or secondary account owner name.- Parameters:
name
- The name to check against the account owner names.- Returns:
- true if the name matches either the primary or secondary account owner name, false otherwise.
-