Enum Direction
- All Implemented Interfaces:
Serializable
,Comparable<Direction>
,java.lang.constant.Constable
Enumeration for sort directions. See Spring Data Commons, but more flat design and independent of
Spring libraries.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Direction
fromString
(String value) static Direction
fromStringOrNull
(String value) boolean
boolean
static Direction
Returns the enum constant of this type with the specified name.static Direction[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ASC
-
DESC
-
-
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
-
isAscending
public boolean isAscending()- Returns:
- true if direction is ascending
-
isDescending
public boolean isDescending()- Returns:
- true if direction is ascending
-
fromString
- Parameters:
value
- given direction value- Returns:
- the direction enumeration
- Throws:
IllegalArgumentException
- in case the given value cannot be parsed into an enum value.
-
fromStringOrNull
- Parameters:
value
- given direction value- Returns:
- the appropriate direction enum or null
-