@Entity public class PurchaseOrder extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PurchaseOrder.Status
Enumerates the status of a Purchase Order.
|
Modifier | Constructor and Description |
---|---|
protected |
PurchaseOrder()
A protected constructor satisfies two purposes:
i) Status and creation time is set consistently. |
|
PurchaseOrder(ShoppingCart cart)
Construct a new order by transferring the content of the given ShoppingCart.
|
Modifier and Type | Method and Description |
---|---|
Customer |
getCustomer()
Gets the customer who placed this Purchase Order.
|
Date |
getDeliveredOn()
Gets the time when this order was delivered.
|
long |
getId()
Gets the immutable, auto-generated persistent identity of this Purchase Order.
|
List<LineItem> |
getItems()
Gets the items for this Purchase Order.
|
Timestamp |
getPlacedOn()
Gets the time when this order was placed.
|
PurchaseOrder.Status |
getStatus()
Gets the status of this Purchase Order.
|
double |
getTotal()
Gets the total cost of all the items in this order.
|
boolean |
isDelivered() |
void |
setDelivered()
|
protected PurchaseOrder()
public PurchaseOrder(ShoppingCart cart)
cart
- a non-null, non-empty Shopping cartNullPointerException
- if the cart is nullIllegalStateException
- if the cart is emptypublic long getId()
public Customer getCustomer()
public PurchaseOrder.Status getStatus()
public boolean isDelivered()
public void setDelivered()
IllegalStateException
- if this order has already been delivered.public List<LineItem> getItems()
setDelivered()
public double getTotal()
public Timestamp getPlacedOn()
public Date getDeliveredOn()
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.