public class Order extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
description |
protected String |
invoiceNumber |
static int |
MAX_DESCRIPTION_LENGTH |
static int |
MAX_INVOICE_NUMBER_LENGTH |
static int |
MAX_ORDER_ITEM_SIZE |
protected List<OrderItem> |
orderItems |
protected String |
purchaseOrderNumber |
protected ShippingCharges |
shippingCharges |
protected BigDecimal |
totalAmount |
| Modifier | Constructor and Description |
|---|---|
protected |
Order() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrderItem(OrderItem orderItem)
Adds an OrderItem to the list of OrderItems - provided the list of items
isn't already at the max of 30.
|
static Order |
createOrder() |
String |
getDescription() |
String |
getInvoiceNumber() |
List<OrderItem> |
getOrderItems() |
String |
getPurchaseOrderNumber() |
ShippingCharges |
getShippingCharges()
Get the shipping charges associated with this order.
|
BigDecimal |
getTotalAmount()
Return the total amount of the order.
|
void |
setDescription(String description) |
void |
setInvoiceNumber(String invoiceNumber) |
void |
setOrderItems(List<OrderItem> orderItems)
Sets the list of OrderItems to the list being passed in.
|
void |
setPurchaseOrderNumber(String purchaseOrderNumber) |
void |
setShippingCharges(ShippingCharges shippingCharges)
Set the shipping charges assocaited with this order.
|
void |
setTotalAmount(BigDecimal totalAmount)
Set the total amount of the order.
|
public static final int MAX_INVOICE_NUMBER_LENGTH
public static final int MAX_DESCRIPTION_LENGTH
public static final int MAX_ORDER_ITEM_SIZE
protected String invoiceNumber
protected String purchaseOrderNumber
protected String description
protected BigDecimal totalAmount
protected ShippingCharges shippingCharges
public static Order createOrder()
public String getInvoiceNumber()
public void setInvoiceNumber(String invoiceNumber)
invoiceNumber - the invoiceNumber to setpublic String getDescription()
public void setDescription(String description)
description - the description to setpublic BigDecimal getTotalAmount()
public void setTotalAmount(BigDecimal totalAmount)
totalAmount - the totalAmount to setpublic void setOrderItems(List<OrderItem> orderItems)
orderItems - the orderItems to setpublic void addOrderItem(OrderItem orderItem)
orderItem - public ShippingCharges getShippingCharges()
public void setShippingCharges(ShippingCharges shippingCharges)
shippingCharges - the shippingCharges to setpublic String getPurchaseOrderNumber()
public void setPurchaseOrderNumber(String purchaseOrderNumber)
purchaseOrderNumber - the purchaseOrderNumber to setCopyright © 2016. All Rights Reserved.