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.ObjectThe ordering of results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSort.Order.DirectionRepresents 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.Orderasc(java.lang.String property)Creates a new order for the given property in ascending order.static Sort.Orderasc(java.lang.String property, boolean ignoreCase)Creates a new order for the given property in ascending order.static Sort.Orderdesc(java.lang.String property)Creates a new order for the given property in descending order.static Sort.Orderdesc(java.lang.String property, boolean ignoreCase)Creates a new order for the given property in descending order.booleanequals(java.lang.Object o)Sort.Order.DirectiongetDirection()java.lang.StringgetProperty()inthashCode()booleanisAscending()booleanisIgnoreCase()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-