Enum SortingData.SortDirection
- java.lang.Object
-
- java.lang.Enum<SortingData.SortDirection>
-
- com.bellotapps.webapps_commons.persistence.repository_utils.SortingData.SortDirection
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SortingData.SortDirection>
- Enclosing class:
- SortingData
public static enum SortingData.SortDirection extends java.lang.Enum<SortingData.SortDirection>
Enum containing the sort directions (i.e ascending and descending).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortingData.SortDirectiondefaultDirection()static SortingData.SortDirectionfromString(java.lang.String value)Returns theSortingData.SortDirectionthat corresponds to the givenvalue.static java.util.Optional<SortingData.SortDirection>fromStringOptional(java.lang.String value)Returns theSortingData.SortDirectionthat corresponds to the givenvalue.booleanisAscending()Returns whether the direction is ascending.booleanisDescending()Returns whether the direction is descending.static SortingData.SortDirectionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SortingData.SortDirection[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ASC
public static final SortingData.SortDirection ASC
The ascending direction.
-
DESC
public static final SortingData.SortDirection DESC
The descending direction.
-
-
Method Detail
-
values
public static SortingData.SortDirection[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SortingData.SortDirection c : SortingData.SortDirection.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SortingData.SortDirection valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
isAscending
public boolean isAscending()
Returns whether the direction is ascending.- Returns:
trueif thisSortingData.SortDirectioncorresponds to the ascending direction (i.ethis.equals(SortDirection.ASC).
-
isDescending
public boolean isDescending()
Returns whether the direction is descending.- Returns:
trueif thisSortingData.SortDirectioncorresponds to the descending direction (i.ethis.equals(SortDirection.DESC).
-
defaultDirection
public static SortingData.SortDirection defaultDirection()
- Returns:
- The default sort direction.
-
fromString
public static SortingData.SortDirection fromString(java.lang.String value)
Returns theSortingData.SortDirectionthat corresponds to the givenvalue.- Parameters:
value- The sort direction value (i.e "asc" or "desc")- Returns:
- The
SortingData.SortDirectionthat corresponds to the givenvalue. - Throws:
java.lang.IllegalArgumentException- in case the given value cannot be parsed into an enum value.
-
fromStringOptional
public static java.util.Optional<SortingData.SortDirection> fromStringOptional(java.lang.String value)
Returns theSortingData.SortDirectionthat corresponds to the givenvalue.- Parameters:
value- The sort direction value (i.e "asc" or "desc")- Returns:
- An
Optionalcontaining theSortingData.SortDirectionthat corresponds to the givenvalue, if there is such, or empty otherwise (i.e thevaluecoult not be parsed into aSortingData.SortDirection).
-
-