Class Queryable.Order<T,U extends Comparable<? super U>>
java.lang.Object
org.apache.groovy.ginq.provider.collection.runtime.Queryable.Order<T,U>
- Type Parameters:
T- the type of element fromQueryableinstanceU- the type of field to sort
Represents an order rule
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Queryable.Order[]Shared empty array for order clauses. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
EMPTY_ARRAY
Shared empty array for order clauses.
-
-
Constructor Details
-
Order
Creates an order rule with nulls sorted last.- Parameters:
keyExtractor- the sort key extractorasc- whether to sort ascending
-
Order
Creates an order rule.- Parameters:
keyExtractor- the sort key extractorasc- whether to sort ascendingnullsLast- whether nulls should be ordered last
-
-
Method Details
-
getKeyExtractor
Returns the sort key extractor.- Returns:
- the sort key extractor
-
isAsc
public boolean isAsc()Indicates whether this rule sorts ascending.- Returns:
truefor ascending order
-
isNullsLast
public boolean isNullsLast()Indicates whether this rule places null values last.- Returns:
trueif nulls are ordered last
-
equals
Compares this rule with another one. -
hashCode
public int hashCode()Returns the hash code of this rule.
-