public class Sort extends Object implements Streamable<Sort.Order>, Serializable
DEFAULT_DIRECTION.| Modifier and Type | Class and Description |
|---|---|
static class |
Sort.Direction
Enumeration for sort directions.
|
static class |
Sort.NullHandling
Enumeration for null handling hints that can be used in
Sort.Order expressions. |
static class |
Sort.Order
PropertyPath implements the pairing of an
Sort.Direction and a property. |
static class |
Sort.TypedSort<T>
Extension of Sort to use method handles to define properties to sort by.
|
| Modifier and Type | Field and Description |
|---|---|
static Sort.Direction |
DEFAULT_DIRECTION |
| Modifier | Constructor and Description |
|---|---|
protected |
Sort(List<Sort.Order> orders) |
| Modifier and Type | Method and Description |
|---|---|
Sort |
and(Sort sort)
|
Sort |
ascending()
Returns a new
Sort with the current setup but ascending order direction. |
static Sort |
by(List<Sort.Order> orders)
Creates a new
Sort for the given Sort.Orders. |
static Sort |
by(Sort.Direction direction,
String... properties)
Creates a new
Sort for the given Sort.Orders. |
static Sort |
by(Sort.Order... orders)
Creates a new
Sort for the given Sort.Orders. |
static Sort |
by(String... properties)
Creates a new
Sort for the given properties. |
Sort |
descending()
Returns a new
Sort with the current setup but descending order direction. |
boolean |
equals(Object obj) |
Sort.Order |
getOrderFor(String property)
Returns the order registered for the given property.
|
int |
hashCode() |
boolean |
isSorted() |
boolean |
isUnsorted() |
Iterator<Sort.Order> |
iterator() |
static <T> Sort.TypedSort<T> |
sort(Class<T> type)
Creates a new
Sort.TypedSort for the given type. |
String |
toString() |
static Sort |
unsorted()
Returns a
Sort instances representing no sorting setup at all. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitand, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamableforEach, spliteratorpublic static final Sort.Direction DEFAULT_DIRECTION
protected Sort(List<Sort.Order> orders)
public static Sort by(String... properties)
Sort for the given properties.properties - must not be null.public static Sort by(List<Sort.Order> orders)
Sort for the given Sort.Orders.orders - must not be null.public static Sort by(Sort.Order... orders)
Sort for the given Sort.Orders.orders - must not be null.public static Sort by(Sort.Direction direction, String... properties)
Sort for the given Sort.Orders.direction - must not be null.properties - must not be null.public static <T> Sort.TypedSort<T> sort(Class<T> type)
Sort.TypedSort for the given type.type - must not be null.public static Sort unsorted()
Sort instances representing no sorting setup at all.public Sort descending()
Sort with the current setup but descending order direction.public Sort ascending()
Sort with the current setup but ascending order direction.public boolean isSorted()
public boolean isUnsorted()
@Nullable public Sort.Order getOrderFor(String property)
property - public Iterator<Sort.Order> iterator()
iterator in interface Iterable<Sort.Order>Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.