Package com.ibm.eznosql.options
Enum Class IndexFlags
- All Implemented Interfaces:
Serializable,Comparable<IndexFlags>,Constable
The IndexFlags enum represents unique and non-unique flags when defining a new secondary index
using
An IndexFlags EnumSet can be constructed by specifying none (default) or multiple flag combinations. The following example demonstrates how to initialize an EnumSet with default or multiple flags:
Database.createIndex(String, String, String, int, EnumSet). Unless specified, a secondary index is
defined with unique keys in ascending order by default. An IndexFlags EnumSet can be constructed by specifying none (default) or multiple flag combinations. The following example demonstrates how to initialize an EnumSet with default or multiple flags:
EnumSet<IndexFlags> flags = EnumSet.noneOf(IndexFlags.class) EnumSet<IndexFlags> flags = EnumSet.of(IndexFlags.NON_UNIQUE_KEYS,
IndexFlags.DESCENDING_KEYS);-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates descending sequential access when retrieving documents through a secondary index.Indicates the creation of a non-unique secondary index. -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetIntFlag(EnumSet<IndexFlags> flags) Getter method for retrieving the numerical value of an IndexFlags enum.static voidstatic IndexFlagsReturns the enum constant of this class with the specified name.static IndexFlags[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NON_UNIQUE_KEYS
Indicates the creation of a non-unique secondary index. Non-unique indexes may contain alternate keys representing one or more documents. The default is unique keys. -
DESCENDING_KEYS
Indicates descending sequential access when retrieving documents through a secondary index. The default is ascending 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
-
getIntFlag
Getter method for retrieving the numerical value of an IndexFlags enum.- Parameters:
flags- The EnumSet of IndexFlags containing one or multiple Enum values.- Returns:
- Returns an integer representing the flag combinations in an EnumSet
-
main
-