public enum DataQueryOrder extends Enum<DataQueryOrder> implements Comparator<DataType>
DataTypes.
The DataQueryOrder enum simply represents some default
implementations of the Comparator required by QueryOptions
and the queryInOrder(Comparator, Consumer) or
order(Comparator) methods.
Users are free to implement their own comparator. However, be aware that
it is possible that more DataTypes may be added in the future.
Ideally the Comparator implementations should be able to handle these
smoothly.
DataQueryOrderFunction| Enum Constant and Description |
|---|
TRANSIENT_FIRST
A data query order indicating that
DataType.TRANSIENT should be queried first. |
TRANSIENT_LAST
A data query order indicating that
DataType.TRANSIENT should be queried last. |
| Modifier and Type | Method and Description |
|---|---|
static List<DataType> |
order(@NonNull Comparator<? super DataType> comparator)
|
static void |
queryInOrder(@NonNull Comparator<? super DataType> comparator,
@NonNull Consumer<? super DataType> action)
|
static DataQueryOrder |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataQueryOrder[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfcompare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final DataQueryOrder TRANSIENT_FIRST
DataType.TRANSIENT should be queried first.public static final DataQueryOrder TRANSIENT_LAST
DataType.TRANSIENT should be queried last.public static DataQueryOrder[] values()
for (DataQueryOrder c : DataQueryOrder.values()) System.out.println(c);
public static DataQueryOrder valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static List<DataType> order(@NonNull Comparator<? super DataType> comparator)
List of all DataTypes, in order of greatest to least, as defined by
the comparator.
Equivalent to calling Arrays.sort(Object[], Comparator) on
DataType.values(), but with the comparator
reversed.
comparator - the comparatorpublic static void queryInOrder(@NonNull Comparator<? super DataType> comparator, @NonNull Consumer<? super DataType> action)
comparator - the comparatoraction - the action