Package de.espirit.common.util
Enum Class SortOrder
- All Implemented Interfaces:
Serializable
,Comparable<SortOrder>
,Constable
Enum providing values to determine the order to be used for sorting.
Encapsulates the conversion of attribute values given by templates to
future-safe order definitions.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSort in ascending orderSort in descending orderKeep order defined by definition -
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrder
Get the order value by a given code.int
Return the comparison result value for greater than depending on the order for sorting.boolean
Indicates, whether the sort ordering depends on language dependent sorting criteria.static @Nullable SortOrder
Exceptional handling to find a sort order by its order code.static SortOrder
Returns the enum constant of this class with the specified name.static SortOrder[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
KEEP_ORDER
Keep order defined by definition- Since:
- 5.2.241303
-
ASCENDING
Sort in ascending order- Since:
- 5.2.241303
-
DESCENDING
Sort in descending order- Since:
- 5.2.241303
-
-
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
-
greaterThan
public int greaterThan()Return the comparison result value for greater than depending on the order for sorting.- Returns:
- The according comparison result.
- Since:
- 5.2.241303
-
isLanguageDependent
public boolean isLanguageDependent()Indicates, whether the sort ordering depends on language dependent sorting criteria.- Returns:
true
if language dependent,false
otherwise- Since:
- 5.2.241303
-
getOrder
Get the order value by a given code.- Parameters:
code
- The code to look up the ordering for or null or an empty string (will return defaultOrder)defaultOrder
- The default order to be returned.- Returns:
- The matching order or defaultOrder.
- Since:
- 5.2.241303
-
valueOf
Exceptional handling to find a sort order by its order code.- Parameters:
code
- The order code.- Returns:
- The matching SortOrder or null.
- Since:
- 5.2.241303
-