| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| MutableTransaction |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Created on Aug 22, 2007 by wyatt | |
| 3 | */ | |
| 4 | package org.homeunix.thecave.buddi.plugin.api.model; | |
| 5 | ||
| 6 | import java.util.Date; | |
| 7 | ||
| 8 | import org.homeunix.thecave.buddi.plugin.api.exception.InvalidValueException; | |
| 9 | ||
| 10 | public interface MutableTransaction extends ImmutableTransaction { | |
| 11 | ||
| 12 | /** | |
| 13 | * Sets the amount associated with this transaction | |
| 14 | * @param amount | |
| 15 | */ | |
| 16 | public void setAmount(long amount) throws InvalidValueException; | |
| 17 | ||
| 18 | /** | |
| 19 | * Marks this transaction as cleared | |
| 20 | * @param cleared | |
| 21 | */ | |
| 22 | public void setClearedFrom(boolean cleared) throws InvalidValueException; | |
| 23 | ||
| 24 | /** | |
| 25 | * Marks this transaction as cleared | |
| 26 | * @param cleared | |
| 27 | */ | |
| 28 | public void setClearedTo(boolean cleared) throws InvalidValueException; | |
| 29 | ||
| 30 | /** | |
| 31 | * Sets the date associated with this account | |
| 32 | * @param date | |
| 33 | */ | |
| 34 | public void setDate(Date date) throws InvalidValueException; | |
| 35 | ||
| 36 | /** | |
| 37 | * Sets the description associated with this account | |
| 38 | * @param description | |
| 39 | */ | |
| 40 | public void setDescription(String description) throws InvalidValueException; | |
| 41 | ||
| 42 | /** | |
| 43 | * Add a split. You must also set exactly one of 'to' or 'from | |
| 44 | * to an instance of ImmutableSplit. | |
| 45 | * @param splits | |
| 46 | */ | |
| 47 | public void addFromSplit(MutableTransactionSplit split) throws InvalidValueException; | |
| 48 | ||
| 49 | /** | |
| 50 | * Remove a split. | |
| 51 | * @param split | |
| 52 | */ | |
| 53 | public void removeFromSplit(MutableTransactionSplit split) throws InvalidValueException; | |
| 54 | ||
| 55 | /** | |
| 56 | * Add a split. You must also set exactly one of 'to' or 'from | |
| 57 | * to an instance of ImmutableSplit. | |
| 58 | * @param splits | |
| 59 | */ | |
| 60 | public void addToSplit(MutableTransactionSplit split) throws InvalidValueException; | |
| 61 | ||
| 62 | /** | |
| 63 | * Remove a split. | |
| 64 | * @param split | |
| 65 | */ | |
| 66 | public void removeToSplit(MutableTransactionSplit split) throws InvalidValueException; | |
| 67 | ||
| 68 | /** | |
| 69 | * Sets the given source as the From field | |
| 70 | * @param from | |
| 71 | */ | |
| 72 | public void setFrom(MutableSource from) throws InvalidValueException; | |
| 73 | ||
| 74 | /** | |
| 75 | * Sets the given memo for this transaction | |
| 76 | * @param memo | |
| 77 | */ | |
| 78 | public void setMemo(String memo) throws InvalidValueException; | |
| 79 | ||
| 80 | /** | |
| 81 | * Sets the cheque number for this transaction | |
| 82 | * @param number | |
| 83 | */ | |
| 84 | public void setNumber(String number) throws InvalidValueException; | |
| 85 | ||
| 86 | /** | |
| 87 | * Marks this transactin as reconciled | |
| 88 | * @param reconciled | |
| 89 | */ | |
| 90 | public void setReconciledFrom(boolean reconciled) throws InvalidValueException; | |
| 91 | ||
| 92 | /** | |
| 93 | * Marks this transactin as reconciled | |
| 94 | * @param reconciled | |
| 95 | */ | |
| 96 | public void setReconciledTo(boolean reconciled) throws InvalidValueException; | |
| 97 | ||
| 98 | /** | |
| 99 | * Set this flag if the transaction was created via a scheduled transaction. | |
| 100 | * @param scheduled | |
| 101 | */ | |
| 102 | public void setScheduled(boolean scheduled) throws InvalidValueException; | |
| 103 | ||
| 104 | /** | |
| 105 | * Sets the given source as the To field | |
| 106 | * @param to | |
| 107 | */ | |
| 108 | public void setTo(MutableSource to) throws InvalidValueException; | |
| 109 | ||
| 110 | ||
| 111 | ||
| 112 | /** | |
| 113 | * Returns the source associated with this transaction's From field | |
| 114 | * @return | |
| 115 | */ | |
| 116 | public MutableSource getFrom(); | |
| 117 | ||
| 118 | /** | |
| 119 | * Returns the source associated with this transaction's To field | |
| 120 | * @return | |
| 121 | */ | |
| 122 | public MutableSource getTo(); | |
| 123 | ||
| 124 | /** | |
| 125 | * Sets the deleted state of the transaction | |
| 126 | * @param deleted | |
| 127 | */ | |
| 128 | public void setDeleted(boolean deleted) throws InvalidValueException; | |
| 129 | } |