📄 banking.java
字号:
package itso.bank.facade;
import itso.bank.exception.AccountDoesNotExistException;
import itso.bank.exception.CustomerDoesNotExistException;
import itso.bank.exception.InsufficientFundsException;
import itso.bank.model.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Collection;
/**
* JavaBean Banking, implementing the banking example fa鏰de.
*
* @author Fabio Ferraz
*/
public class Banking implements Serializable {
// the Bank
private transient Bank bank;
private Bank getBank() {
if (bank == null) bank = Bank.getInstance();
return bank;
}
// business methods
public BigDecimal deposit(String accountID, BigDecimal amount)
throws AccountDoesNotExistException {
return getBank().deposit(accountID, amount);
}
public BigDecimal withdraw(String accountID, BigDecimal amount)
throws InsufficientFundsException, AccountDoesNotExistException {
return getBank().withdraw(accountID, amount);
}
public BigDecimal transfer(String accountID1, String accountID2, BigDecimal amount)
throws InsufficientFundsException, AccountDoesNotExistException {
return getBank().transfer(accountID1, accountID2, amount);
}
public Customer getCustomer(String customerID) throws CustomerDoesNotExistException {
return getBank().getCustomer(customerID);
}
public Account getAccount(String accountID) throws AccountDoesNotExistException {
return getBank().getAccount(accountID);
}
public Account[] getAccounts(String customerID) throws CustomerDoesNotExistException {
return getBank().getAccounts(customerID);
}
public TransRecord[] getTransactions(String accountID) throws AccountDoesNotExistException {
return getBank().getTransactions(accountID);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -