Enum Class IndexType

java.lang.Object
java.lang.Enum<IndexType>
io.objectbox.annotation.IndexType
All Implemented Interfaces:
Serializable, Comparable<IndexType>, Constable

public enum IndexType extends Enum<IndexType>
ObjectBox offers a value and two hash index types, from which it chooses a reasonable default (see DEFAULT).

For some queries/use cases it might make sense to override the default choice for optimization purposes.

Note: hash indexes are currently only supported for string properties.

  • Enum Constant Details

    • DEFAULT

      public static final IndexType DEFAULT
      Use the default index type depending on the property type: VALUE for scalars and HASH for Strings.
    • VALUE

      public static final IndexType VALUE
      Use the property value to build the index. For Strings this may occupy more space than the default setting.
    • HASH

      public static final IndexType HASH
      Use a (fast non-cryptographic) hash of the property value to build the index. Internally, it uses a 32 bit hash with a decent hash collision behavior. Because occasional collisions do not really impact performance, this is usually a better choice than HASH64 as it takes less space.
    • HASH64

      public static final IndexType HASH64
      Use a long (fast non-cryptographic) hash of the property value to build the index.
  • Method Details

    • values

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