Class CheckingAccount

java.lang.Object
com.dada.banking_project.models.Accounts.Account
com.dada.banking_project.models.Accounts.CheckingAccount
Direct Known Subclasses:
StudentCheckingAccount

@Entity public class CheckingAccount extends Account
This class represents a checking account, a type of bank account that typically allows for frequent deposits and withdrawals.
  • 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

      public CheckingAccount(String secondaryOwner, String primaryOwner, AccountHolder accountHolder)
      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

      public CheckingAccount(String secondaryOwner)
  • Method Details

    • setMinimumBalance

      public void setMinimumBalance(BigDecimal minimumBalance)
      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

      public void setMonthlyMaintenanceFee(BigDecimal monthlyMaintenanceFee)
      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.