Package org.kiwiproject.spring.data
Enum Class KiwiSort.Direction
- All Implemented Interfaces:
Serializable,Comparable<KiwiSort.Direction>,Constable
- Enclosing class:
- KiwiSort
Sort direction.
-
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
FieldsModifier and TypeFieldDescriptionfinal booleanAccessible via a getter method as well as direct field access. -
Method Summary
Modifier and TypeMethodDescriptionstatic KiwiSort.DirectionfromString(String value) Converts the given value to aKiwiSort.Directionin a case-insensitive manner and ignoring leading and trailing whitespace.booleanAccessible via a getter method as well as direct field access.booleanConvenience method to allow checking if thisKiwiSort.Directionis descending.static KiwiSort.DirectionReturns the enum constant of this class with the specified name.static KiwiSort.Direction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ASC
An ascending sort. -
DESC
A descending sort.
-
-
Field Details
-
ascending
public final boolean ascendingAccessible via a getter method as well as direct field access.
-
-
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
-
fromString
Converts the given value to aKiwiSort.Directionin a case-insensitive manner and ignoring leading and trailing whitespace.- Parameters:
value- the value to convert- Returns:
- the
KiwiSort.Directionrepresenting the given value - Throws:
IllegalArgumentException- if there is noKiwiSort.Directionthat matches ignoring case and stripping leading and trailing whitespace
-
isDescending
public boolean isDescending()Convenience method to allow checking if thisKiwiSort.Directionis descending.- Returns:
- true if this sort is descending, false if ascending
-
isAscending
public boolean isAscending()Accessible via a getter method as well as direct field access.
-