|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.core.ShoppingOrder
This ShoppingOrder is a labelled list of shopping items.
| Field Summary | |
protected Money |
theComputedDiscountSubtotal
The computer total discount value of the order. |
protected Money |
theComputedSubtotal
The total price of the order. |
protected Money |
theComputedTaxSubtotal
The total price of the order. |
protected Money |
theDiscount
The discount of the order. |
protected Money |
theGrandTotal
The total price of the order to be paid by the user. |
protected Long |
theId
items' id used as a key by hibernate |
protected List |
theItems
a list of items that make up this order. |
protected String |
theLabel
an arbitrary label for the order |
protected Money |
theSubtotal
The total price of the order less discounts and tax. |
protected String |
theTaxNote
note about the tax |
protected Money |
theTaxPaid
The total tax of the item. |
protected Long |
theTransactionId
unique transaction id that is sent to the payment authorisation agent |
| Constructor Summary | |
ShoppingOrder()
null constructor required by hibernate. |
|
ShoppingOrder(ShoppingOrder o)
constructor that takes another order and creates a new one with the same values but a new transaction id. |
|
ShoppingOrder(String label)
constructor takes a description. |
|
| Method Summary | |
void |
addItem(ShoppingItem item)
Add a shopping item and increment the order's price. |
boolean |
equals(Object o)
Tests if the supplied object is equal to this ShoppingOrder. |
Money |
getComputedDiscountSubtotal()
Returns the computed discount. |
Money |
getComputedSubtotal()
Returns the computed subtotal. |
Money |
getComputedTaxSubtotal()
Returns the computed discount. |
Money |
getDiscount()
Returns the discount. |
Integer |
getDiscountAmount()
Returns the total discount amount. |
Money |
getGrandTotal()
Returns the grand total. |
Integer |
getGrandTotalAmount()
Returns the subtotal amount. |
Long |
getId()
Get the ShoppingOrder's ID number. |
ShoppingItem |
getItem(int index)
Get the item in the order with index provided. |
List |
getItems()
returns the list of items in this order. |
String |
getLabel()
Returns the label. |
Money |
getSubtotal()
Returns the subtotal. |
Integer |
getSubtotalAmount()
Returns the subtotal amount. |
Integer |
getTaxAmount()
Returns the total tax. |
String |
getTaxNote()
Returns the total taxNote. |
Money |
getTaxPaid()
Returns the total tax. |
Long |
getTransactionId()
Get the ShoppingOrder's Transaction ID number. |
int |
hashcode()
the hashcode. |
void |
removeItem(ShoppingItem item)
Remove a shopping item and decrement the order's price. |
void |
setDiscount(Money dis)
Set the discount of this ShoppingOrder. |
void |
setDiscountAmount(Integer discount)
Set the discount of this ShoppingOrder. |
void |
setGrandTotal(Money sub)
Set the grand total of this ShoppingOrder. |
void |
setGrandTotalAmount(Integer aGrandTotal)
Set the grand total of this ShoppingOrder. |
protected void |
setId(Long id)
Sets the The ShoppingOrder's ID number. |
protected void |
setItems(List items)
set the items list. |
void |
setLabel(String aLabel)
Set the label for this ShoppingOrder. |
void |
setSubtotal(Money sub)
Set the subtotal of this ShoppingOrder. |
void |
setSubtotalAmount(Integer aSubtotal)
Set the subtotal of this ShoppingOrder. |
void |
setTaxAmount(Integer tax)
Set the tax of this ShoppingOrder. |
void |
setTaxNote(String note)
Set the taxNote of this ShoppingOrder. |
void |
setTaxPaid(Money tax)
Set the tax of this ShoppingOrder. |
void |
setTemplateId(Long id)
Sets the The ShoppingOrder's ID number directly. |
protected void |
setTransactionId(Long id)
Sets the The ShoppingOrder's Transaction ID number. |
String |
toString()
a simple string description of the order. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Long theId
protected Long theTransactionId
protected String theLabel
protected Money theComputedSubtotal
protected Money theSubtotal
protected Money theGrandTotal
protected Money theDiscount
protected Money theComputedDiscountSubtotal
protected Money theComputedTaxSubtotal
protected Money theTaxPaid
protected String theTaxNote
protected List theItems
| Constructor Detail |
public ShoppingOrder()
public ShoppingOrder(String label)
public ShoppingOrder(ShoppingOrder o)
o - the order to copy from.| Method Detail |
public Long getId()
ShoppingOrder's ID number.
getId in interface PersistableShoppingOrder's ID number.protected void setId(Long id)
ShoppingOrder's ID number.
id - The ID number to set.public void setTemplateId(Long id)
ShoppingOrder's ID number directly. This is only
to be used when creating a template object, and is not to be used when
creating actual objects that will be persisted.
setTemplateId in interface Persistableid - The ID number to set.public Long getTransactionId()
ShoppingOrder's Transaction ID number.
ShoppingOrder's Transaction ID number.protected void setTransactionId(Long id)
ShoppingOrder's Transaction ID number.
id - The Transaction ID number to set.protected void setItems(List items)
items - The List of itemspublic List getItems()
public void addItem(ShoppingItem item)
item - The item to add.public void removeItem(ShoppingItem item)
item - The item to remove.public ShoppingItem getItem(int index)
index - the index of the item in the list.
public String getLabel()
public void setLabel(String aLabel)
aLabel - The label for this ShoppingOrder.public Money getDiscount()
public void setDiscount(Money dis)
dis - The discount of this ShoppingOrder.public Money getComputedDiscountSubtotal()
public Money getTaxPaid()
public void setTaxPaid(Money tax)
tax - The tax of this ShoppingOrder.public Money getComputedTaxSubtotal()
public Integer getTaxAmount()
public void setTaxAmount(Integer tax)
tax - The tax of this ShoppingOrder.public Money getSubtotal()
public void setSubtotal(Money sub)
sub - The subtotal of this ShoppingOrder.public Integer getSubtotalAmount()
public Money getComputedSubtotal()
public void setSubtotalAmount(Integer aSubtotal)
aSubtotal - The subtotal of this ShoppingOrder.public Money getGrandTotal()
public void setGrandTotal(Money sub)
sub - The grand total of this ShoppingOrder.public Integer getGrandTotalAmount()
public void setGrandTotalAmount(Integer aGrandTotal)
aGrandTotal - The grand total of this ShoppingOrder.public Integer getDiscountAmount()
public void setDiscountAmount(Integer discount)
discount - The discount on this ShoppingOrder.public String getTaxNote()
public void setTaxNote(String note)
note - The taxNote of this ShoppingOrder.public boolean equals(Object o)
o - The object to test against this ShoppingOrder. Must also be a ShoppingOrder
to make sense.
public String toString()
public int hashcode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||