public final class SortKey extends Object
A sort key describing a sort operation.
Modifier and Type | Method and Description |
---|---|
static SortKey |
create(TypedName<? extends Comparable> attr)
Create a new sort key in ascending order.
|
static SortKey |
create(TypedName<? extends Comparable> attr,
SortOrder ord)
Create a new sort key.
|
static <T> SortKey |
create(TypedName<T> attr,
Comparator<? super T> comp)
Create a new sort key with a value comparator.
|
boolean |
equals(Object o) |
TypedName<?> |
getAttribute()
Get the attribute to sort by.
|
SortOrder |
getOrder()
Get the sort order.
|
boolean |
hasCustomComparator()
Query whether this sort key has a custom comparator.
|
int |
hashCode() |
Ordering<Entity> |
ordering()
Create an ordering (comparator) over entities from this sort key.
|
public static SortKey create(TypedName<? extends Comparable> attr)
Create a new sort key in ascending order.
attr
- The attribute.public static SortKey create(TypedName<? extends Comparable> attr, SortOrder ord)
Create a new sort key.
attr
- The attribute.ord
- The sort order.public static <T> SortKey create(TypedName<T> attr, Comparator<? super T> comp)
Create a new sort key with a value comparator.
attr
- The attribute.comp
- A comparator to use.public TypedName<?> getAttribute()
Get the attribute to sort by.
public boolean hasCustomComparator()
Query whether this sort key has a custom comparator.
public Ordering<Entity> ordering()
Create an ordering (comparator) over entities from this sort key.