Enum Class IndexFlags

java.lang.Object
java.lang.Enum<IndexFlags>
com.ibm.eznosql.options.IndexFlags
All Implemented Interfaces:
Serializable, Comparable<IndexFlags>, Constable

public enum IndexFlags extends Enum<IndexFlags>
The IndexFlags enum represents unique and non-unique flags when defining a new secondary index using 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);
  • Enum Constant Details

    • NON_UNIQUE_KEYS

      public static final IndexFlags 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

      public static final IndexFlags DESCENDING_KEYS
      Indicates descending sequential access when retrieving documents through a secondary index. The default is ascending access.
  • Method Details

    • values

      public static IndexFlags[] 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

      public static IndexFlags valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getIntFlag

      public static int getIntFlag(EnumSet<IndexFlags> flags)
      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

      public static void main(String[] args)