Class Sort.Order
java.lang.Object
com.blazebit.persistence.deltaspike.data.Sort.Order
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Sort
public static class Sort.Order extends Object implements Serializable
PropertyPath implements the pairing of an
Sort.Direction and a property. It is used to provide input for
Sort- Since:
- 1.2.0
- Author:
- Christian Beikov
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Order(Sort.Direction direction, String path)Creates a newSort.Orderwith the given direction and path.Order(Sort.Direction direction, String path, Sort.NullHandling nullHandling)Creates a newSort.Orderwith the given direction, path and null handling.Order(String path)Creates a newSort.Orderwith the given path andSort.Direction.ASC. -
Method Summary
Modifier and Type Method Description voidappendTo(StringBuilder sb)Appends the string representation to the givenStringBuilder.booleanequals(Object obj)Sort.DirectiongetDirection()Returns the sort direction.Sort.NullHandlinggetNullHandling()Returns theSort.NullHandling.StringgetPath()Returns the path of the Sort.Order.inthashCode()Sort.OrderignoreCase()Returns a newSort.Orderwith case insensitive sorting enabled.booleanisAscending()Returns whether sorting for this property should be ascending.booleanisDescending()Returns whether sorting for this path should be descending.booleanisIgnoreCase()Returns whether or not the sort will be case sensitive.Sort.OrdernullsFirst()Returns a newSort.OrderwithSort.NullHandling.NULLS_FIRSTas null handling.Sort.OrdernullsLast()Returns a newSort.OrderwithSort.NullHandling.NULLS_LASTas null handling.Sort.OrdernullsNative()Returns a newSort.OrderwithSort.NullHandling.NATIVEas null handling.StringtoString()Sort.Orderwith(Sort.Direction direction)Returns a newSort.Orderwith the givenSort.Direction.Sort.Orderwith(Sort.NullHandling nullHandling)Returns a newSort.Orderwith the givenSort.NullHandling.Sort.OrderwithPath(String path)Returns a newSort.Orderwith the same configuration as thisSort.Order, but the given path.
-
Constructor Details
-
Order
Creates a newSort.Orderwith the given direction and path.- Parameters:
direction- TheSort.Directionto use, defaults toSort.Direction.ASCifnullpath- The path to sort by
-
Order
Creates a newSort.Orderwith the given direction, path and null handling.- Parameters:
direction- TheSort.Directionto use, defaults toSort.Direction.ASCifnullpath- The path to sort bynullHandling- TheSort.NullHandlingto use, defaults toSort.NullHandling.NATIVEifnull
-
Order
Creates a newSort.Orderwith the given path andSort.Direction.ASC.- Parameters:
path- The path to sort by
-
-
Method Details
-
getDirection
Returns the sort direction.- Returns:
- The sort direction
-
getPath
Returns the path of the Sort.Order.- Returns:
- The path to sort by
-
isAscending
public boolean isAscending()Returns whether sorting for this property should be ascending.- Returns:
trueif sorting is ascending,falseotherwise
-
isDescending
public boolean isDescending()Returns whether sorting for this path should be descending.- Returns:
trueif sorting is descending,falseotherwise
-
isIgnoreCase
public boolean isIgnoreCase()Returns whether or not the sort will be case sensitive.- Returns:
trueif case insensitive,falseotherwise
-
with
Returns a newSort.Orderwith the givenSort.Direction.- Parameters:
direction- TheSort.Directionto use, defaults toSort.Direction.ASCifnull- Returns:
- A new
Sort.Orderwith the givenSort.Direction
-
withPath
Returns a newSort.Orderwith the same configuration as thisSort.Order, but the given path.- Parameters:
path- The path- Returns:
- A new
Sort.Orderwith the same configuration as thisSort.Order, but the given path
-
ignoreCase
Returns a newSort.Orderwith case insensitive sorting enabled.- Returns:
- A new
Sort.Orderwith case insensitive sorting enabled
-
with
Returns a newSort.Orderwith the givenSort.NullHandling.- Parameters:
nullHandling- TheSort.NullHandlingto use, defaults toSort.NullHandling.NATIVEifnull- Returns:
- A new
Sort.Orderwith the givenSort.NullHandling
-
nullsFirst
Returns a newSort.OrderwithSort.NullHandling.NULLS_FIRSTas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NULLS_FIRSTas null handling
-
nullsLast
Returns a newSort.OrderwithSort.NullHandling.NULLS_LASTas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NULLS_LASTas null handling
-
nullsNative
Returns a newSort.OrderwithSort.NullHandling.NATIVEas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NATIVEas null handling
-
getNullHandling
Returns theSort.NullHandling.- Returns:
- The
Sort.NullHandling
-
appendTo
Appends the string representation to the givenStringBuilder.- Parameters:
sb- TheStringBuilderto append to
-
hashCode
public int hashCode() -
equals
-
toString
-