| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
package org.homeunix.thecave.buddi.plugin.api.model.impl; |
| 5 | |
|
| 6 | |
import java.util.Date; |
| 7 | |
|
| 8 | |
import org.homeunix.thecave.buddi.model.Account; |
| 9 | |
import org.homeunix.thecave.buddi.plugin.api.exception.InvalidValueException; |
| 10 | |
import org.homeunix.thecave.buddi.plugin.api.model.MutableAccount; |
| 11 | |
import org.homeunix.thecave.buddi.plugin.api.model.MutableAccountType; |
| 12 | |
|
| 13 | 0 | public class MutableAccountImpl extends MutableSourceImpl implements MutableAccount { |
| 14 | |
|
| 15 | |
public MutableAccountImpl(Account account) { |
| 16 | 0 | super(account); |
| 17 | 0 | } |
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
public void setStartingBalance(long startingBalance) throws InvalidValueException { |
| 24 | 0 | getAccount().setStartingBalance(startingBalance); |
| 25 | 0 | } |
| 26 | |
|
| 27 | |
public void setAccountType(MutableAccountType type) throws InvalidValueException { |
| 28 | 0 | getAccount().setAccountType(type.getType()); |
| 29 | 0 | } |
| 30 | |
|
| 31 | |
public Account getAccount() { |
| 32 | 0 | return (Account) getSource(); |
| 33 | |
} |
| 34 | |
|
| 35 | |
public long getBalance() { |
| 36 | 0 | return getAccount().getBalance(); |
| 37 | |
} |
| 38 | |
|
| 39 | |
public long getStartingBalance() { |
| 40 | 0 | return getAccount().getStartingBalance(); |
| 41 | |
} |
| 42 | |
|
| 43 | |
public MutableAccountType getAccountType() { |
| 44 | 0 | if (getAccount().getAccountType() != null) |
| 45 | 0 | return new MutableAccountTypeImpl(getAccount().getAccountType()); |
| 46 | 0 | return null; |
| 47 | |
} |
| 48 | |
public Date getStartDate() { |
| 49 | 0 | return getAccount().getStartDate(); |
| 50 | |
} |
| 51 | |
public long getBalance(Date d) { |
| 52 | 0 | return getAccount().getBalance(d); |
| 53 | |
} |
| 54 | |
@Override |
| 55 | |
public String toString() { |
| 56 | 0 | return getFullName(); |
| 57 | |
} |
| 58 | |
|
| 59 | |
public long getOverdraftCreditLimit() { |
| 60 | 0 | return getAccount().getOverdraftCreditLimit(); |
| 61 | |
} |
| 62 | |
|
| 63 | |
public void setOverdraftCreditLimit(long overdraftCreditLimit) throws InvalidValueException { |
| 64 | 0 | getAccount().setOverdraftCreditLimit(overdraftCreditLimit); |
| 65 | 0 | } |
| 66 | |
|
| 67 | |
public void setStartDate(Date startDate) { |
| 68 | 0 | getAccount().setStartDate(startDate); |
| 69 | 0 | } |
| 70 | |
|
| 71 | |
public void setInterestRate(long interestRate) throws InvalidValueException { |
| 72 | 0 | getAccount().setInterestRate(interestRate); |
| 73 | 0 | } |
| 74 | |
|
| 75 | |
public long getInterestRate() { |
| 76 | 0 | return getAccount().getInterestRate(); |
| 77 | |
} |
| 78 | |
} |