public interface Sort
Modifier and Type | Interface and Description |
---|---|
static class |
Sort.Order
The ordering of results.
|
Modifier and Type | Field and Description |
---|---|
static Sort |
UNSORTED
Constant for unsorted.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Sort.Order> |
getOrderBy() |
boolean |
isSorted() |
static Sort |
of(java.util.List<Sort.Order> orderList)
Create a sort from the given list of orders.
|
static Sort |
of(Sort.Order... orders)
Creates a sort from an array orders.
|
Sort |
order(Sort.Order order)
Adds an order object.
|
Sort |
order(java.lang.String propertyName)
Orders by the specified property name (defaults to ascending).
|
Sort |
order(java.lang.String propertyName,
Sort.Order.Direction direction)
Orders by the specified property name and direction.
|
static Sort |
unsorted() |
static final Sort UNSORTED
boolean isSorted()
@NonNull Sort order(@NonNull java.lang.String propertyName)
propertyName
- The property name to order by@NonNull Sort order(@NonNull Sort.Order order)
order
- The order object@NonNull Sort order(@NonNull java.lang.String propertyName, @NonNull Sort.Order.Direction direction)
propertyName
- The property name to order bydirection
- Either "asc" for ascending or "desc" for descending@NonNull java.util.List<Sort.Order> getOrderBy()
static Sort unsorted()
@NonNull static Sort of(@Nullable java.util.List<Sort.Order> orderList)
orderList
- The order list@NonNull static Sort of(Sort.Order... orders)
orders
- The orders