JCash/src/me/teridax/jcash/banking/Profile.java

42 lines
920 B
Java

package me.teridax.jcash.banking;
public class Profile {
private Owner owner;
private Bank bank;
private Account primaryAccount;
private Account[] accounts;
public Profile(Owner owner, Bank bank, Account account, Account[] accounts) {
this.owner = owner;
this.bank = bank;
this.accounts = accounts;
this.primaryAccount = account;
}
public Account getPrimaryAccount() {
return primaryAccount;
}
public Owner getOwner() {
return owner;
}
public Bank getBank() {
return bank;
}
public Account[] getAccounts() {
return accounts;
}
public void setPrimaryAccount(String description) {
for (Account account : accounts) {
if (account.getDescription().equals(description)) {
this.primaryAccount = account;
break;
}
}
}
}