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 anSort.Directionand a property. It is used to provide input forSort- 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
All Methods Instance Methods Concrete Methods 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 Detail
-
Order
public Order(Sort.Direction direction, String path)
Creates a newSort.Orderwith the given direction and path.- Parameters:
direction- TheSort.Directionto use, defaults toSort.Direction.ASCifnullpath- The path to sort by
-
Order
public Order(Sort.Direction direction, String path, Sort.NullHandling nullHandling)
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
public Order(String path)
Creates a newSort.Orderwith the given path andSort.Direction.ASC.- Parameters:
path- The path to sort by
-
-
Method Detail
-
getDirection
public Sort.Direction getDirection()
Returns the sort direction.- Returns:
- The sort direction
-
getPath
public String 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
public Sort.Order with(Sort.Direction direction)
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
public Sort.Order withPath(String path)
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
public Sort.Order ignoreCase()
Returns a newSort.Orderwith case insensitive sorting enabled.- Returns:
- A new
Sort.Orderwith case insensitive sorting enabled
-
with
public Sort.Order with(Sort.NullHandling nullHandling)
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
public Sort.Order nullsFirst()
Returns a newSort.OrderwithSort.NullHandling.NULLS_FIRSTas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NULLS_FIRSTas null handling
-
nullsLast
public Sort.Order nullsLast()
Returns a newSort.OrderwithSort.NullHandling.NULLS_LASTas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NULLS_LASTas null handling
-
nullsNative
public Sort.Order nullsNative()
Returns a newSort.OrderwithSort.NullHandling.NATIVEas null handling.- Returns:
- A new
Sort.OrderwithSort.NullHandling.NATIVEas null handling
-
getNullHandling
public Sort.NullHandling getNullHandling()
Returns theSort.NullHandling.- Returns:
- The
Sort.NullHandling
-
appendTo
public void appendTo(StringBuilder sb)
Appends the string representation to the givenStringBuilder.- Parameters:
sb- TheStringBuilderto append to
-
-