@Entity public class Order extends AbstractEntity<OrderIdentifier>
Modifier | Constructor and Description |
---|---|
protected |
Order()
Deprecated.
|
|
Order(UserAccount userAccount)
Creates a new Order
|
|
Order(UserAccount userAccount,
PaymentMethod paymentMethod)
|
Modifier and Type | Method and Description |
---|---|
void |
add(ChargeLine chargeLine) |
void |
add(OrderLine orderLine)
|
(package private) void |
cancel() |
(package private) void |
complete() |
Iterable<ChargeLine> |
getChargeLines() |
org.joda.money.Money |
getChargeLinesPrice() |
LocalDateTime |
getDateCreated() |
OrderIdentifier |
getIdentifier()
Returns the
SalespointIdentifier . |
(package private) int |
getNumberOfLineItems() |
org.joda.money.Money |
getOrderedLinesPrice() |
Iterable<OrderLine> |
getOrderLines() |
OrderStatus |
getOrderStatus() |
PaymentMethod |
getPaymentMethod() |
org.joda.money.Money |
getTotalPrice() |
UserAccount |
getUserAccount() |
boolean |
isCanceled()
Convenience method for checking if an order has the status CANCELLED
|
boolean |
isCompleted()
Convenience method for checking if an order has the status COMPLETED
|
boolean |
isOpen()
Convenience method for checking if an order has the status OPEN
|
boolean |
isPaid()
Convenience method for checking if an order has the status PAID
|
(package private) boolean |
isPaymentExpected() |
(package private) ProductPaymentEntry |
markPaid() |
void |
remove(ChargeLine chargeLine) |
void |
remove(OrderLine orderLine) |
(package private) void |
setDateCreated(LocalDateTime dateTime) |
void |
setPaymentMethod(PaymentMethod paymentMethod) |
String |
toString() |
equals, getId, hashCode, isNew
@Deprecated protected Order()
public Order(UserAccount userAccount)
userAccount
- The UserAccount
connected to this order, must not be null.public Order(UserAccount userAccount, PaymentMethod paymentMethod)
userAccount
- The UserAccount
connected to this order, must not be null.paymentMethod
- The PaymentMethod
connected to this order, must not be null.public final OrderIdentifier getIdentifier()
AbstractEntity
SalespointIdentifier
.getIdentifier
in class AbstractEntity<OrderIdentifier>
public Iterable<ChargeLine> getChargeLines()
public final OrderStatus getOrderStatus()
public final UserAccount getUserAccount()
public org.joda.money.Money getTotalPrice()
public org.joda.money.Money getOrderedLinesPrice()
public org.joda.money.Money getChargeLinesPrice()
public final LocalDateTime getDateCreated()
public void add(OrderLine orderLine)
orderLine
- the OrderLine
to be added.IllegalArgumentException
- if orderLine is null.public void remove(OrderLine orderLine)
public void add(ChargeLine chargeLine)
public void remove(ChargeLine chargeLine)
public boolean isPaid()
public boolean isCanceled()
public boolean isCompleted()
public boolean isOpen()
public final PaymentMethod getPaymentMethod()
public void setPaymentMethod(PaymentMethod paymentMethod)
void complete()
void cancel()
int getNumberOfLineItems()
boolean isPaymentExpected()
ProductPaymentEntry markPaid()
void setDateCreated(LocalDateTime dateTime)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.