public final class SortKey
extends java.lang.Object
A sort key describing a sort operation.
Modifier and Type | Method and Description |
---|---|
static SortKey |
create(TypedName<? extends java.lang.Comparable> attr)
Create a new sort key in ascending order.
|
static SortKey |
create(TypedName<? extends java.lang.Comparable> attr,
SortOrder ord)
Create a new sort key.
|
static <T> SortKey |
create(TypedName<T> attr,
java.util.Comparator<? super T> comp)
Create a new sort key with a value comparator.
|
boolean |
equals(java.lang.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 java.lang.Comparable> attr)
Create a new sort key in ascending order.
attr
- The attribute.public static SortKey create(TypedName<? extends java.lang.Comparable> attr, SortOrder ord)
Create a new sort key.
attr
- The attribute.ord
- The sort order.public static <T> SortKey create(TypedName<T> attr, java.util.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.
@Nullable public SortOrder getOrder()
Get the sort order.
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.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object