Class Sort.Order

java.lang.Object
io.micronaut.data.model.Sort.Order
Enclosing interface:
Sort

public static class Sort.Order extends Object
The ordering of results.
  • Constructor Details

    • Order

      public Order(@NonNull @NonNull String property)
      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 property
      direction - The direction
      ignoreCase - Whether to ignore case
  • Method Details

    • isIgnoreCase

      public boolean isIgnoreCase()
      Returns:
      Whether to ignore case when sorting
    • getDirection

      public Sort.Order.Direction getDirection()
      Returns:
      The direction order by
    • getProperty

      public String getProperty()
      Returns:
      The property name to order by
    • desc

      public static Sort.Order desc(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(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(String property, boolean ignoreCase)
      Creates a new order for the given property in descending order.
      Parameters:
      property - The property
      ignoreCase - Whether to ignore case
      Returns:
      The order instance
    • asc

      public static Sort.Order asc(String property, boolean ignoreCase)
      Creates a new order for the given property in ascending order.
      Parameters:
      property - The property
      ignoreCase - Whether to ignore case
      Returns:
      The order instance
    • isAscending

      public boolean isAscending()
      Returns:
      Is the order ascending
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object