java.lang.Object
com.dada.banking_project.models.Accounts.Account
Direct Known Subclasses:
CheckingAccount, CreditCardAccount, SavingAccount

@Entity public class Account extends Object
This class represents a generic account.
  • Constructor Details

  • Method Details

    • setSecretKey

      public void setSecretKey()
    • checkBalance

      public boolean checkBalance(BigDecimal amount)
      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

      public boolean checkOwnerName(String name)
      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.