Enum Class DataQueryOrder
- All Implemented Interfaces:
Serializable,Comparable<DataQueryOrder>,java.lang.constant.Constable,Comparator<DataType>
Represents the order in which to query different
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA data query order indicating thatDataType.TRANSIENTshould be queried first.A data query order indicating thatDataType.TRANSIENTshould be queried last. -
Method Summary
Modifier and TypeMethodDescriptionorder(@NonNull Comparator<? super DataType> comparator) static voidqueryInOrder(@NonNull Comparator<? super DataType> comparator, @NonNull Consumer<? super DataType> action) static DataQueryOrderReturns the enum constant of this class with the specified name.static DataQueryOrder[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Enum Constant Details
-
TRANSIENT_FIRST
A data query order indicating thatDataType.TRANSIENTshould be queried first. -
TRANSIENT_LAST
A data query order indicating thatDataType.TRANSIENTshould be queried last.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
order
Gets aListof allDataTypes, in order of greatest to least, as defined by thecomparator.Equivalent to calling
Arrays.sort(Object[], Comparator)onDataType.values(), but with the comparatorreversed.- Parameters:
comparator- the comparator- Returns:
- the ordered data types
-
queryInOrder
public static void queryInOrder(@NonNull Comparator<? super DataType> comparator, @NonNull Consumer<? super DataType> action) - Parameters:
comparator- the comparatoraction- the action
-