Class CheckingAccount
java.lang.Object
com.dada.banking_project.models.Accounts.Account
com.dada.banking_project.models.Accounts.CheckingAccount
- Direct Known Subclasses:
StudentCheckingAccount
This class represents a checking account, a type of bank account that typically allows for frequent deposits and withdrawals.
-
Constructor Summary
ConstructorDescriptionCheckingAccount
(String secondaryOwner) CheckingAccount
(String secondaryOwner, String primaryOwner, AccountHolder accountHolder) This constructor creates a new CheckingAccount object with the given primary owner, secondary owner, and account holder.CheckingAccount
(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) This class represents a checking account, a type of bank account that typically allows for frequent deposits and withdrawals. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setMinimumBalance
(BigDecimal minimumBalance) Set the minimum balance for this Checking account.void
setMonthlyMaintenanceFee
(BigDecimal monthlyMaintenanceFee) This method sets the monthly maintenance fee for the checking account.Methods inherited from class com.dada.banking_project.models.Accounts.Account
checkBalance, checkOwnerName, setSecretKey
-
Constructor Details
-
CheckingAccount
public CheckingAccount(BigDecimal balance, String primaryOwner, String secondaryOwner, String status, AccountHolder accountHolder) This class represents a checking account, a type of bank account that typically allows for frequent deposits and withdrawals. -
CheckingAccount
This constructor creates a new CheckingAccount object with the given primary owner, secondary owner, and account holder. If the account holder is under 24 years old, the minimum balance and monthly maintenance fee will be set to zero. Otherwise, they will be set to their default values.- Parameters:
secondaryOwner
- The secondary owner of the checking account.primaryOwner
- The primary owner of the checking account.accountHolder
- The account holder associated with the checking account.
-
CheckingAccount
public CheckingAccount() -
CheckingAccount
-
-
Method Details
-
setMinimumBalance
Set the minimum balance for this Checking account.- Parameters:
minimumBalance
- The minimum balance to set, must be greater than or equal to 250.- Throws:
IllegalArgumentException
- if minimum balance is less than 250.
-
setMonthlyMaintenanceFee
This method sets the monthly maintenance fee for the checking account. If the given monthly maintenance fee is less than the default value of 12, an IllegalArgumentException is thrown.- Parameters:
monthlyMaintenanceFee
- The monthly maintenance fee to set.- Throws:
IllegalArgumentException
- If the given monthly maintenance fee is less than the default value of 12.
-