Class Account

java.lang.Object
clazzfish.sample.jdbc.Account

public final class Account extends Object
A simple bank account.
Since:
1.3.1 (16.07.2013)
Author:
oboehm
  • Constructor Details

    • Account

      public Account(int id, User user)
      Instantiates a new account.
      Parameters:
      id - the account number
      user - the user
  • Method Details

    • getId

      public int getId()
      Gets the number.
      Returns:
      the number
    • getHolder

      public User getHolder()
      Gets the holder.
      Returns:
      the holder
    • setBalance

      public void setBalance(BigDecimal balance)
      Sets the balance.
      Parameters:
      balance - the new balance
    • getBalance

      public BigDecimal getBalance()
      Gets the balance.
      Returns:
      the balance
    • deposit

      public void deposit(BigDecimal amount)
      Pay in some money.
      Parameters:
      amount - the amount
    • deposit

      public void deposit(String amount)
      Deposit.
      Parameters:
      amount - the amount
    • debit

      public void debit(BigDecimal amount)
      Pay off some money.
      Parameters:
      amount - the amount
    • debit

      public void debit(String amount)
      Pay off some money.
      Parameters:
      amount - the amount
    • transfer

      public void transfer(BigDecimal amount, Account to)
      Transfer an amount from one accout to another account.
      Parameters:
      amount - the amount
      to - the account where the amount is transferred to.
    • transfer

      public void transfer(String amount, Account to)
      Transfer an amount from one accout to another account.
      Parameters:
      amount - the amount
      to - the account where the amount is transferred to.
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string
      See Also: