Package com.helger.commons.compare
Enum ESortOrder
- All Implemented Interfaces:
ISortOrderIndicator,Serializable,Comparable<ESortOrder>,java.lang.constant.Constable
Defines possible sort orders. The default is
ASCENDING sorting.- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet the alternate sort order.static ESortOrdergetFromValue(int nValue, ESortOrder eDefault) static ESortOrdergetFromValueOrDefault(int nValue) intgetValue()booleanstatic ESortOrderReturns the enum constant of this type with the specified name.static ESortOrder[]values()Returns an array containing the constants of this enum type, 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 com.helger.commons.compare.ISortOrderIndicator
isDescending
-
Enum Constant Details
-
ASCENDING
-
DESCENDING
-
-
Field Details
-
DEFAULT
The default sort order isASCENDING
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
- Returns:
- The associated value for this sort order. The value can directly be used in compare methods to multiply the initial return value with this value to have the correct ordering.
-
getValueAsString
-
isAscending
public boolean isAscending()- Specified by:
isAscendingin interfaceISortOrderIndicator- Returns:
trueis ascending sort order is active.
-
getAlternate
Get the alternate sort order. If the current sort order is ascending, the result will be descending and if this is descending, the return will be ascending.- Returns:
- Never
null.
-
getFromValueOrDefault
-
getFromValue
-