Package org.graylog2.rest.models
Enum Class SortOrder
- All Implemented Interfaces:
Serializable,Comparable<SortOrder>,Constable
Sort order for querying MongoDB to be used as a query param in REST resources.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrderfromString(String order) abstract org.bson.conversions.BsontoBsonSort(String... fields) Generate a Bson sort object that can be used directly as a parameter for querying MongoDB.abstract org.bson.conversions.BsontoBsonSort(List<String> fields) Generate a Bson sort object that can be used directly as a parameter for querying MongoDB.static SortOrderReturns 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
-
ASCENDING
-
DESCENDING
-
-
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
-
toBsonSort
Generate a Bson sort object that can be used directly as a parameter for querying MongoDB. CallsSorts.ascending(String...)orSorts.descending(String...)as appropriate.- Parameters:
fields- Fields to sort on in the specified order.- Returns:
- A BSON object as returned by the
Sortsfactory methods
-
toBsonSort
Generate a Bson sort object that can be used directly as a parameter for querying MongoDB. CallsSorts.ascending(List)orSorts.descending(List)as appropriate.- Parameters:
fields- Fields to sort on in the specified order.- Returns:
- A BSON object as returned by the
Sortsfactory methods
-