public class Sort
extends java.lang.Object
implements java.io.Serializable
Based on the Sort
class from Spring Data project.
Modifier and Type | Class and Description |
---|---|
static class |
Sort.Direction
Sort direction.
|
static class |
Sort.Order
Sort order defines a property and corresponding
Sort.Direction . |
Modifier and Type | Field and Description |
---|---|
static Sort |
UNSORTED
Undefined sort order.
|
Modifier | Constructor and Description |
---|---|
protected |
Sort(java.util.List<Sort.Order> orders) |
protected |
Sort(Sort.Direction direction,
java.util.List<java.lang.String> properties) |
Modifier and Type | Method and Description |
---|---|
static Sort |
by(java.util.List<Sort.Order> orders)
Creates new
Sort for the given list of orders. |
static Sort |
by(Sort.Direction direction,
java.lang.String... properties)
Creates new
Sort for the given properties with the given direction. |
static Sort |
by(Sort.Order... orders)
Creates new
Sort for the given orders. |
static Sort |
by(java.lang.String... properties)
Creates new
Sort for the given properties with ASC direction. |
java.util.List<Sort.Order> |
getOrders()
Returns unmodifiable list of orders.
|
java.lang.String |
toString() |
public static final Sort UNSORTED
protected Sort(java.util.List<Sort.Order> orders)
protected Sort(Sort.Direction direction, java.util.List<java.lang.String> properties)
public static Sort by(java.util.List<Sort.Order> orders)
Sort
for the given list of orders.public static Sort by(Sort.Order... orders)
Sort
for the given orders.public static Sort by(java.lang.String... properties)
Sort
for the given properties with ASC direction.public static Sort by(Sort.Direction direction, java.lang.String... properties)
Sort
for the given properties with the given direction.public java.util.List<Sort.Order> getOrders()
public java.lang.String toString()
toString
in class java.lang.Object