public final class SortKey extends Object
Constructor and Description |
---|
SortKey(String field,
boolean isAscendingOrder) |
Modifier and Type | Method and Description |
---|---|
static SortKey |
ascendingOrder(String field)
Creates a new ascending-order sort key for the provided field.
|
static SortKey |
descendingOrder(String field)
Creates a new descending-order sort key for the provided field.
|
String |
getField()
Returns the sort key field.
|
boolean |
isAscendingOrder()
Returns
true if this sort key is in ascending order, or
false if it is in descending order. |
static SortKey |
reverseOrder(SortKey key)
Creates a new sort key having the same field as the provided key, but in
reverse sort order.
|
String |
toString()
Returns the string representation of this sort key.
|
public SortKey(String field, boolean isAscendingOrder)
public static SortKey ascendingOrder(String field)
field
- The sort key field.IllegalArgumentException
- If field
is not a valid attribute name.public static SortKey descendingOrder(String field)
field
- The sort key field.IllegalArgumentException
- If field
is not a valid attribute name.public static SortKey reverseOrder(SortKey key)
key
- The sort key to be reversed.public String getField()
public boolean isAscendingOrder()
true
if this sort key is in ascending order, or
false
if it is in descending order.true
if this sort key is in ascending order, or
false
if it is in descending ord)er.public String toString()
Copyright © 2022. All rights reserved.