Enum OrderedIndex.OrderDirection
- java.lang.Object
-
- java.lang.Enum<OrderedIndex.OrderDirection>
-
- org.apache.jackrabbit.oak.plugins.index.property.OrderedIndex.OrderDirection
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<OrderedIndex.OrderDirection>
- Enclosing interface:
- OrderedIndex
public static enum OrderedIndex.OrderDirection extends java.lang.Enum<OrderedIndex.OrderDirection>
enum for easing the order direction of the index
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OrderedIndex.OrderDirection
fromIndexMeta(NodeState indexMeta)
tells whether the provided index definition is ascending or descendingstatic @Nullable OrderedIndex.OrderDirection
fromString(@NotNull java.lang.String direction)
retrieve anOrderDirection
from a provided String.java.lang.String
getDirection()
boolean
isAscending()
static boolean
isAscending(NodeState indexMeta)
convenience method that tells if the provided index definition is ascendingboolean
isDescending()
static boolean
isDescending(NodeState indexMeta)
convenience method that tells if the provided index definition is descendingstatic OrderedIndex.OrderDirection
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static OrderedIndex.OrderDirection[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ASC
public static final OrderedIndex.OrderDirection ASC
ascending order configuration (default)
-
DESC
public static final OrderedIndex.OrderDirection DESC
descending order configuration
-
-
Method Detail
-
values
public static OrderedIndex.OrderDirection[] 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 (OrderedIndex.OrderDirection c : OrderedIndex.OrderDirection.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OrderedIndex.OrderDirection 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
-
getDirection
public java.lang.String getDirection()
-
fromString
@Nullable public static @Nullable OrderedIndex.OrderDirection fromString(@NotNull @NotNull java.lang.String direction)
retrieve anOrderDirection
from a provided String. Will return null in case of no-match- Parameters:
direction
- the direction of the sorting: ascending or descending- Returns:
- the direction
-
fromIndexMeta
public static OrderedIndex.OrderDirection fromIndexMeta(NodeState indexMeta)
tells whether the provided index definition is ascending or descending- Parameters:
indexMeta
-- Returns:
- the direction
-
isDescending
public static boolean isDescending(NodeState indexMeta)
convenience method that tells if the provided index definition is descending- Parameters:
indexMeta
-- Returns:
- true if descending
-
isAscending
public boolean isAscending()
-
isDescending
public boolean isDescending()
-
isAscending
public static boolean isAscending(NodeState indexMeta)
convenience method that tells if the provided index definition is ascending- Parameters:
indexMeta
-- Returns:
- true if ascending
-
-