public interface OrderManager<T extends Order>
Orders.| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelOrder(T order)
Cancels an
Order, it can only be cancelled is OrderStatus is OPEN. |
OrderCompletionResult |
completeOrder(T order)
Tries to complete this order, the
OrderStatus has to be PAID. |
boolean |
contains(OrderIdentifier orderIdentifier)
Checks if this
OrderManager contains an order. |
Iterable<T> |
findBy(Interval interval)
|
Iterable<T> |
findBy(OrderStatus orderStatus)
|
Iterable<T> |
findBy(UserAccount userAccount)
Returns all
Orders of the given UserAccount. |
Iterable<T> |
findBy(UserAccount userAccount,
Interval interval)
Returns all
Orders from the given UserAccount in between the dates from and to,
including from and to. |
Optional<T> |
get(OrderIdentifier orderIdentifier)
Returns the order identified by an
OrderIdentifier |
boolean |
payOrder(T order)
|
T |
save(T order)
Saves the given
Order or persists changes to it. |
T save(T order)
Order or persists changes to it.order - the order to be saved, must not be null.Optional<T> get(OrderIdentifier orderIdentifier)
OrderIdentifierorderIdentifier - identifier of the Order to be returned, must not be null.Optional.empty().boolean contains(OrderIdentifier orderIdentifier)
OrderManager contains an order.orderIdentifier - the OrderIdentifier of the Order, must not be null.Iterable<T> findBy(OrderStatus orderStatus)
Orders having the OrderStatus status. If no orders with the specified status
exist, an empty Iterable is returned.orderStatus - Denoting the OrderStatus on which the Orders will be requested.Orders with the specified OrderStatusIterable<T> findBy(UserAccount userAccount)
Orders of the given UserAccount. If this user has no orders, an empty Iterable
is returned.userAccount - Denoting the UserAccount on which the orders will be requested, must not be
null.Iterable containing all orders of the specified user.Iterable<T> findBy(UserAccount userAccount, Interval interval)
Orders from the given UserAccount in between the dates from and to,
including from and to. So every entry with an time stamp <= to and >= from is returned. If this user has no
Orders in this period, an empty Iterable is returned.userAccount - The UserAccount whose Orders shall be returned, must not be null.interval - The time interval to find Orders in, must not be null.Iterable containing all orders from the specified user in the specified period.OrderCompletionResult completeOrder(T order)
OrderStatus has to be PAID.order - the order to complete, must not be null.OrderCompletionResultboolean payOrder(T order)
order - the order to be payed, must not be null.boolean cancelOrder(T order)
Order, it can only be cancelled is OrderStatus is OPEN.order - the order to be canceled, must not be null.Copyright © 2016 Pivotal Software, Inc.. All rights reserved.