public interface Order
Order encapsulates the semantics of a result set sorting. Any given
time, objects of this class can exist in one of two modes: building
or built. When an Order is
built, it is guaranteed to represent a fully and well formed sort
order that can be processed. On the other hand, when a Order is
building it is in an incomplete state.
This class is the public interface to Order construction. It is meant to
be used in a chained manner, where the caller initially calls
by(java.lang.String) and continues to construct the Order using the
options available from each subsequently returned state.
| Modifier and Type | Method and Description |
|---|---|
static OrderByState |
by(String key)
Start building a new
Order. |
static Order |
none()
Return an
Order that specifies no order. |
List<OrderComponent> |
spec()
Return the order specification, expressed as an ordered list of
components containing each key, an optional
Timestamp and the the corresponding direction ordinal (e.g. |
static OrderByState by(String key)
Order.List<OrderComponent> spec()
components containing each key, an optional
Timestamp and the the corresponding direction ordinal (e.g. 1 for
ASC and -1 for DESC) in the constructed Order.