Package: org.apache.groovy.ginq.provider.collection.runtime

## [Java] Class Queryable.Order<T, U extends Comparable<? super U>>

- org.apache.groovy.ginq.provider.collection.runtime.Queryable.Order

-     public class Queryable.Order<T, U extends Comparable<? super U>>
      extends Object

  Represents an order rule

  Type Parameters:
    `T` - the type of element from Queryable instance
    `U` - the type of field to sort
  Since:
    4.0.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static Order[]` | `EMPTY_ARRAY` | Shared empty array for order clauses.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Order(Function<? super T, ? extends U> keyExtractor, boolean asc)` Creates an order rule with nulls sorted last.
    `Order(Function<? super T, ? extends U> keyExtractor, boolean asc, boolean nullsLast)` Creates an order rule.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `equals(Object o)` Compares this rule with another one.
    `` | `public Function<? super T, ? extends U>` | `getKeyExtractor()` Returns the sort key extractor.
    `` | `public int` | `hashCode()` Returns the hash code of this rule.
    `` | `public boolean` | `isAsc()` Indicates whether this rule sorts ascending.
    `` | `public boolean` | `isNullsLast()` Indicates whether this rule places null values last.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final Order[] EMPTY_ARRAY

      Shared empty array for order clauses.

  - ### Constructor Detail

    - #### public Order(Function<? super T, ? extends U> keyExtractor, boolean asc)

      Creates an order rule with nulls sorted last.

      Parameters:
        `keyExtractor` - the sort key extractor
        `asc` - whether to sort ascending

    - #### public Order(Function<? super T, ? extends U> keyExtractor, boolean asc, boolean nullsLast)

      Creates an order rule.

      Parameters:
        `keyExtractor` - the sort key extractor
        `asc` - whether to sort ascending
        `nullsLast` - whether nulls should be ordered last

  - ### Method Detail

    - #### public boolean equals(Object o)

      Compares this rule with another one.

      Parameters:
        `o` - the other object
      Returns:
        `true` if both rules are equal

    - #### public Function<? super T, ? extends U> getKeyExtractor()

      Returns the sort key extractor.

      Returns:
        the sort key extractor

    - #### public int hashCode()

      Returns the hash code of this rule.

      Returns:
        the hash code

    - #### public boolean isAsc()

      Indicates whether this rule sorts ascending.

      Returns:
        `true` for ascending order

    - #### public boolean isNullsLast()

      Indicates whether this rule places null values last.

      Returns:
        `true` if nulls are ordered last