org.homeunix.thecave.buddi.plugin.api.model.impl
Class MutableTransactionImpl

java.lang.Object
  extended by org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
      extended by org.homeunix.thecave.buddi.plugin.api.model.impl.MutableModelObjectImpl
          extended by org.homeunix.thecave.buddi.plugin.api.model.impl.MutableTransactionImpl
All Implemented Interfaces:
java.lang.Comparable<ImmutableModelObject>, ImmutableModelObject, ImmutableTransaction, MutableTransaction
Direct Known Subclasses:
MutableScheduledTransactionImpl

public class MutableTransactionImpl
extends MutableModelObjectImpl
implements MutableTransaction


Constructor Summary
MutableTransactionImpl(Transaction transaction)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 long getAmount()
          Returns the amouns associated with this transaction
 long getBalanceFrom()
          Returns the balance in the From account at the point in time of this transaction
 long getBalanceTo()
          Returns the balance in the To account at the point in time of this transaction
 java.util.Date getDate()
          Returns the date associated with this transaction
 java.lang.String getDescription()
          Returns the description associated with this transaction
 MutableSourceImpl getFrom()
          Returns the source associated with this transaction's From field
 java.lang.String getMemo()
          Returns the memo associated with this transaction
 java.lang.String getNumber()
          Returns the cheque number associated with this transaction
 MutableSourceImpl getTo()
          Returns the source associated with this transaction's To field
 Transaction getTransaction()
          Returns the wrapped object from the underlying data model.
 boolean isClearedFrom()
          Is this transaction marked as cleared?
 boolean isClearedTo()
          Is this transaction marked as cleared?
 boolean isDeleted()
          Is the transaction marked as deleted?
 boolean isInflow()
          Does this transacton represent an inflow of cash or an outflow?
 boolean isReconciledFrom()
          Is this transaction marked as reconciled?
 boolean isReconciledTo()
          Is this transaction marked as reconciled?
 boolean isScheduled()
          Was this transaction created through a scheduled transaction?
 void setAmount(long amount)
          Sets the amount associated with this transaction
 void setClearedFrom(boolean cleared)
          Marks this transaction as cleared
 void setClearedTo(boolean cleared)
          Marks this transaction as cleared
 void setDate(java.util.Date date)
          Sets the date associated with this account
 void setDeleted(boolean deleted)
          Sets the deleted state of the transaction
 void setDescription(java.lang.String description)
          Sets the description associated with this account
 void setFrom(MutableSource from)
          Sets the given source as the From field
 void setMemo(java.lang.String memo)
          Sets the given memo for this transaction
 void setNumber(java.lang.String number)
          Sets the cheque number for this transaction
 void setReconciledFrom(boolean reconciled)
          Marks this transactin as reconciled
 void setReconciledTo(boolean reconciled)
          Marks this transactin as reconciled
 void setScheduled(boolean scheduled)
          Set this flag if the transaction was created via a scheduled transaction.
 void setTo(MutableSource to)
          Sets the given source as the To field
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
compareTo, getModified, getRaw, getUid, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject
getModified, getRaw, getUid
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

MutableTransactionImpl

public MutableTransactionImpl(Transaction transaction)
Method Detail

getTransaction

public Transaction getTransaction()
Description copied from interface: ImmutableTransaction
Returns the wrapped object from the underlying data model. By accessing this method, you bypass all protection which the Buddi API gives you; it is not recommended to use this method unless you understand the risks associated with it.

Specified by:
getTransaction in interface ImmutableTransaction
Returns:

isClearedFrom

public boolean isClearedFrom()
Description copied from interface: ImmutableTransaction
Is this transaction marked as cleared?

Specified by:
isClearedFrom in interface ImmutableTransaction
Returns:

isClearedTo

public boolean isClearedTo()
Description copied from interface: ImmutableTransaction
Is this transaction marked as cleared?

Specified by:
isClearedTo in interface ImmutableTransaction
Returns:

isReconciledFrom

public boolean isReconciledFrom()
Description copied from interface: ImmutableTransaction
Is this transaction marked as reconciled?

Specified by:
isReconciledFrom in interface ImmutableTransaction
Returns:

isReconciledTo

public boolean isReconciledTo()
Description copied from interface: ImmutableTransaction
Is this transaction marked as reconciled?

Specified by:
isReconciledTo in interface ImmutableTransaction
Returns:

getDate

public java.util.Date getDate()
Description copied from interface: ImmutableTransaction
Returns the date associated with this transaction

Specified by:
getDate in interface ImmutableTransaction
Returns:

getDescription

public java.lang.String getDescription()
Description copied from interface: ImmutableTransaction
Returns the description associated with this transaction

Specified by:
getDescription in interface ImmutableTransaction
Returns:

getMemo

public java.lang.String getMemo()
Description copied from interface: ImmutableTransaction
Returns the memo associated with this transaction

Specified by:
getMemo in interface ImmutableTransaction
Returns:

getNumber

public java.lang.String getNumber()
Description copied from interface: ImmutableTransaction
Returns the cheque number associated with this transaction

Specified by:
getNumber in interface ImmutableTransaction
Returns:

isScheduled

public boolean isScheduled()
Description copied from interface: ImmutableTransaction
Was this transaction created through a scheduled transaction?

Specified by:
isScheduled in interface ImmutableTransaction
Returns:

getFrom

public MutableSourceImpl getFrom()
Description copied from interface: ImmutableTransaction
Returns the source associated with this transaction's From field

Specified by:
getFrom in interface ImmutableTransaction
Specified by:
getFrom in interface MutableTransaction
Returns:

getTo

public MutableSourceImpl getTo()
Description copied from interface: ImmutableTransaction
Returns the source associated with this transaction's To field

Specified by:
getTo in interface ImmutableTransaction
Specified by:
getTo in interface MutableTransaction
Returns:

getBalanceFrom

public long getBalanceFrom()
Description copied from interface: ImmutableTransaction
Returns the balance in the From account at the point in time of this transaction

Specified by:
getBalanceFrom in interface ImmutableTransaction
Returns:

getBalanceTo

public long getBalanceTo()
Description copied from interface: ImmutableTransaction
Returns the balance in the To account at the point in time of this transaction

Specified by:
getBalanceTo in interface ImmutableTransaction
Returns:

isInflow

public boolean isInflow()
Description copied from interface: ImmutableTransaction
Does this transacton represent an inflow of cash or an outflow?

Specified by:
isInflow in interface ImmutableTransaction
Returns:

getAmount

public long getAmount()
Description copied from interface: ImmutableTransaction
Returns the amouns associated with this transaction

Specified by:
getAmount in interface ImmutableTransaction
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class ImmutableModelObjectImpl

setAmount

public void setAmount(long amount)
Description copied from interface: MutableTransaction
Sets the amount associated with this transaction

Specified by:
setAmount in interface MutableTransaction

setClearedFrom

public void setClearedFrom(boolean cleared)
                    throws InvalidValueException
Description copied from interface: MutableTransaction
Marks this transaction as cleared

Specified by:
setClearedFrom in interface MutableTransaction
Throws:
InvalidValueException

setClearedTo

public void setClearedTo(boolean cleared)
                  throws InvalidValueException
Description copied from interface: MutableTransaction
Marks this transaction as cleared

Specified by:
setClearedTo in interface MutableTransaction
Throws:
InvalidValueException

setDate

public void setDate(java.util.Date date)
             throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the date associated with this account

Specified by:
setDate in interface MutableTransaction
Throws:
InvalidValueException

setDescription

public void setDescription(java.lang.String description)
                    throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the description associated with this account

Specified by:
setDescription in interface MutableTransaction
Throws:
InvalidValueException

setFrom

public void setFrom(MutableSource from)
             throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the given source as the From field

Specified by:
setFrom in interface MutableTransaction
Throws:
InvalidValueException

setMemo

public void setMemo(java.lang.String memo)
             throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the given memo for this transaction

Specified by:
setMemo in interface MutableTransaction
Throws:
InvalidValueException

setNumber

public void setNumber(java.lang.String number)
               throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the cheque number for this transaction

Specified by:
setNumber in interface MutableTransaction
Throws:
InvalidValueException

setReconciledFrom

public void setReconciledFrom(boolean reconciled)
                       throws InvalidValueException
Description copied from interface: MutableTransaction
Marks this transactin as reconciled

Specified by:
setReconciledFrom in interface MutableTransaction
Throws:
InvalidValueException

setReconciledTo

public void setReconciledTo(boolean reconciled)
                     throws InvalidValueException
Description copied from interface: MutableTransaction
Marks this transactin as reconciled

Specified by:
setReconciledTo in interface MutableTransaction
Throws:
InvalidValueException

setTo

public void setTo(MutableSource to)
           throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the given source as the To field

Specified by:
setTo in interface MutableTransaction
Throws:
InvalidValueException

setScheduled

public void setScheduled(boolean scheduled)
                  throws InvalidValueException
Description copied from interface: MutableTransaction
Set this flag if the transaction was created via a scheduled transaction.

Specified by:
setScheduled in interface MutableTransaction
Throws:
InvalidValueException

isDeleted

public boolean isDeleted()
Description copied from interface: ImmutableTransaction
Is the transaction marked as deleted?

Specified by:
isDeleted in interface ImmutableTransaction
Returns:

setDeleted

public void setDeleted(boolean deleted)
                throws InvalidValueException
Description copied from interface: MutableTransaction
Sets the deleted state of the transaction

Specified by:
setDeleted in interface MutableTransaction
Throws:
InvalidValueException