com.greenpepper.samples.application.bank.SavingsAccount Maven / Gradle / Ivy
package com.greenpepper.samples.application.bank;
/**
* SavingsAccount class.
*
* @author oaouattara
* @version $Id: $Id
*/
public class SavingsAccount extends BankAccount
{
/**
* Constructor for SavingsAccount.
*
* @param number a {@link java.lang.String} object.
* @param owner a {@link com.greenpepper.samples.application.bank.Owner} object.
*/
public SavingsAccount(String number, Owner owner)
{
super(AccountType.SAVINGS, number, owner);
}
/** {@inheritDoc} */
public void checkFunds(Money amount) throws Exception
{
if (getBalance().lowerThan(amount)) throw new Exception("Not enougth money !");
}
}