Package io.micronaut.data.model
Class Sort.Order
- java.lang.Object
-
- io.micronaut.data.model.Sort.Order
-
- Enclosing interface:
- Sort
public static class Sort.Order extends java.lang.Object
The ordering of results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.Order.Direction
Represents the direction of the ordering.
-
Constructor Summary
Constructors Constructor Description Order(java.lang.String property)
Constructs an order for the given property in ascending order.Order(java.lang.String property, Sort.Order.Direction direction, boolean ignoreCase)
Constructs an order for the given property with the given direction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Sort.Order
asc(java.lang.String property)
Creates a new order for the given property in ascending order.static Sort.Order
asc(java.lang.String property, boolean ignoreCase)
Creates a new order for the given property in ascending order.static Sort.Order
desc(java.lang.String property)
Creates a new order for the given property in descending order.static Sort.Order
desc(java.lang.String property, boolean ignoreCase)
Creates a new order for the given property in descending order.boolean
equals(java.lang.Object o)
Sort.Order.Direction
getDirection()
java.lang.String
getProperty()
int
hashCode()
boolean
isAscending()
boolean
isIgnoreCase()
-
-
-
Constructor Detail
-
Order
public Order(@NonNull java.lang.String property)
Constructs an order for the given property in ascending order.- Parameters:
property
- The property
-
Order
public Order(@NonNull java.lang.String property, @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 Detail
-
isIgnoreCase
public boolean isIgnoreCase()
- Returns:
- Whether to ignore case when sorting
-
getDirection
public Sort.Order.Direction getDirection()
- Returns:
- The direction order by
-
getProperty
public java.lang.String getProperty()
- Returns:
- The property name to order by
-
desc
public static Sort.Order desc(java.lang.String property)
Creates a new order for the given property in descending order.- Parameters:
property
- The property- Returns:
- The order instance
-
asc
public static Sort.Order asc(java.lang.String property)
Creates a new order for the given property in ascending order.- Parameters:
property
- The property- Returns:
- The order instance
-
desc
public static Sort.Order desc(java.lang.String property, boolean ignoreCase)
Creates a new order for the given property in descending order.- Parameters:
property
- The propertyignoreCase
- Whether to ignore case- Returns:
- The order instance
-
asc
public static Sort.Order asc(java.lang.String property, boolean ignoreCase)
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-