Package io.micronaut.data.model
Class Sort.Order
java.lang.Object
io.micronaut.data.model.Sort.Order
- Enclosing interface:
- Sort
The ordering of results.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the direction of the ordering. -
Constructor Summary
ConstructorDescriptionConstructs an order for the given property in ascending order.Order
(@NonNull String property, @NonNull Sort.Order.Direction direction, boolean ignoreCase) Constructs an order for the given property with the given direction. -
Method Summary
Modifier and TypeMethodDescriptionstatic Sort.Order
Creates a new order for the given property in ascending order.static Sort.Order
Creates a new order for the given property in ascending order.static Sort.Order
Creates a new order for the given property in descending order.static Sort.Order
Creates a new order for the given property in descending order.boolean
int
hashCode()
boolean
boolean
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
@Creator public Order(@NonNull @NonNull String property, @NonNull @NonNull Sort.Order.Direction direction, boolean ignoreCase) Constructs an order for the given property with the given direction.- Parameters:
property
- The propertydirection
- The directionignoreCase
- Whether to ignore case
-
-
Method Details
-
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
-
isAscending
public boolean isAscending()- Returns:
- Is the order ascending
-
toString
-
equals
-
hashCode
public int hashCode()
-