public static class Sort.Order extends Object implements Serializable
Sort.Direction and a property. It is used to provide input for
Sort| Constructor and Description |
|---|
Order(Sort.Direction direction,
String property)
Creates a new
Sort.Order instance. if order is null then order defaults to
Sort.DEFAULT_DIRECTION |
Order(Sort.Direction direction,
String property,
Sort.NullHandling nullHandlingHint)
Creates a new
Sort.Order instance. if order is null then order defaults to
Sort.DEFAULT_DIRECTION |
| Modifier and Type | Method and Description |
|---|---|
static Sort.Order |
asc(String property)
Creates a new
Sort.Order instance. |
static Sort.Order |
by(String property)
Creates a new
Sort.Order instance. |
static Sort.Order |
desc(String property)
Creates a new
Sort.Order instance. |
boolean |
equals(Object obj) |
Sort.Direction |
getDirection()
Returns the order the property shall be sorted for.
|
Sort.NullHandling |
getNullHandling()
Returns the used
Sort.NullHandling hint, which can but may not be respected by the used datastore. |
String |
getProperty()
Returns the property to order for.
|
int |
hashCode() |
Sort.Order |
ignoreCase()
Returns a new
Sort.Order with case insensitive sorting enabled. |
boolean |
isAscending()
Returns whether sorting for this property shall be ascending.
|
boolean |
isDescending()
Returns whether sorting for this property shall be descending.
|
boolean |
isIgnoreCase()
Returns whether or not the sort will be case sensitive.
|
Sort.Order |
nullsFirst()
Returns a
Sort.Order with Sort.NullHandling.NULLS_FIRST as null handling hint. |
Sort.Order |
nullsLast()
Returns a
Sort.Order with Sort.NullHandling.NULLS_LAST as null handling hint. |
Sort.Order |
nullsNative()
Returns a
Sort.Order with Sort.NullHandling.NATIVE as null handling hint. |
String |
toString() |
Sort.Order |
with(Sort.Direction direction)
Returns a new
Sort.Order with the given Sort.Direction. |
Sort.Order |
with(Sort.NullHandling nullHandling)
Returns a
Sort.Order with the given Sort.NullHandling. |
Sort |
withProperties(String... properties)
Returns a new
Sort instance for the given properties. |
Sort.Order |
withProperty(String property)
Returns a new
Sort.Order |
public Order(@Nullable Sort.Direction direction, String property)
Sort.Order instance. if order is null then order defaults to
Sort.DEFAULT_DIRECTIONdirection - can be null, will default to Sort.DEFAULT_DIRECTIONproperty - must not be null or empty.public Order(@Nullable Sort.Direction direction, String property, Sort.NullHandling nullHandlingHint)
Sort.Order instance. if order is null then order defaults to
Sort.DEFAULT_DIRECTIONdirection - can be null, will default to Sort.DEFAULT_DIRECTIONproperty - must not be null or empty.nullHandling - must not be null.public static Sort.Order by(String property)
Sort.Order instance. Takes a single property. Direction defaults to
Sort.DEFAULT_DIRECTION.property - must not be null or empty.public static Sort.Order asc(String property)
Sort.Order instance. Takes a single property. Direction is Sort.Direction.ASC and
NullHandling Sort.NullHandling.NATIVE.property - must not be null or empty.public static Sort.Order desc(String property)
Sort.Order instance. Takes a single property. Direction is Sort.Direction.DESC and
NullHandling Sort.NullHandling.NATIVE.property - must not be null or empty.public Sort.Direction getDirection()
public String getProperty()
public boolean isAscending()
public boolean isDescending()
public boolean isIgnoreCase()
public Sort.Order with(Sort.Direction direction)
Sort.Order with the given Sort.Direction.direction - public Sort.Order withProperty(String property)
Sort.Orderproperty - must not be null or empty.public Sort withProperties(String... properties)
Sort instance for the given properties.properties - public Sort.Order ignoreCase()
Sort.Order with case insensitive sorting enabled.public Sort.Order with(Sort.NullHandling nullHandling)
Sort.Order with the given Sort.NullHandling.nullHandling - can be null.public Sort.Order nullsFirst()
Sort.Order with Sort.NullHandling.NULLS_FIRST as null handling hint.public Sort.Order nullsLast()
Sort.Order with Sort.NullHandling.NULLS_LAST as null handling hint.public Sort.Order nullsNative()
Sort.Order with Sort.NullHandling.NATIVE as null handling hint.public Sort.NullHandling getNullHandling()
Sort.NullHandling hint, which can but may not be respected by the used datastore.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.