Class Sort.Order
java.lang.Object
io.micronaut.data.model.Sort.Order
- Direct Known Subclasses:
ExpressionOrder
- Enclosing interface:
Sort
The ordering of results.
- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the direction of the ordering.static enumRepresents where null values are placed relative to non-null values. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an order for the given property in ascending order.Order(String property, Sort.Order.Direction direction, boolean ignoreCase) Constructs an order for the given property with the given direction.Order(String property, Sort.Order.Direction direction, boolean ignoreCase, @Nullable Sort.Order.NullOrdering nullOrdering) Constructs an order for the given property with the given direction and null ordering. -
Method Summary
Modifier and TypeMethodDescriptionstatic Sort.OrderCreates a new order for the given property in ascending order.static Sort.OrderCreates a new order for the given property in ascending order.static Sort.OrderCreates a new order for the given property in descending order.static Sort.OrderCreates a new order for the given property in descending order.booleaninthashCode()booleanbooleanstatic Sort.OrderCreates a new order for the given property in ascending order.reverse()Create an order that is reversed to current.toString()
-
Constructor Details
-
Order
Constructs an order for the given property in ascending order.- Parameters:
property- The property
-
Order
Constructs an order for the given property with the given direction.- Parameters:
property- The propertydirection- The directionignoreCase- Whether to ignore case
-
Order
@Creator public Order(String property, Sort.Order.Direction direction, boolean ignoreCase, @Nullable Sort.Order.NullOrdering nullOrdering) Constructs an order for the given property with the given direction and null ordering.- Parameters:
property- The propertydirection- The directionignoreCase- Whether to ignore casenullOrdering- Where to place null values relative to non-null values,nullis treated asSort.Order.NullOrdering.NONEso that payloads written before 5.2 still deserialize- Since:
- 5.2
-
-
Method Details
-
getNullOrdering
- Returns:
- Where null values are placed relative to non-null values
- Since:
- 5.2
-
isIgnoreCase
public boolean isIgnoreCase()- Returns:
- Whether to ignore case when sorting
-
getDirection
- Returns:
- The direction order by
-
getProperty
- Returns:
- The property name to order by
-
reverse
Create an order that is reversed to current.- Returns:
- A new instance of order that is reversed.
-
desc
Creates a new order for the given property in descending order.- Parameters:
property- The property- Returns:
- The order instance
-
asc
Creates a new order for the given property in ascending order.- Parameters:
property- The property- Returns:
- The order instance
-
desc
Creates a new order for the given property in descending order.- Parameters:
property- The propertyignoreCase- Whether to ignore case- Returns:
- The order instance
-
asc
Creates a new order for the given property in ascending order.- Parameters:
property- The propertyignoreCase- Whether to ignore case- Returns:
- The order instance
-
of
Creates a new order for the given property in ascending order.- Parameters:
property- The propertyignoreCase- Whether to ignore case- Returns:
- The order instance
- Since:
- 4.13
-
isAscending
public boolean isAscending()- Returns:
- Is the order ascending
-
toString
-
equals
-
hashCode
-