Package io.objectbox.annotation
Enum IndexType
- java.lang.Object
-
- java.lang.Enum<IndexType>
-
- io.objectbox.annotation.IndexType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IndexType>
public enum IndexType extends java.lang.Enum<IndexType>
ObjectBox offers a value and two hash index types, from which it chooses a reasonable default (seeDEFAULT
).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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IndexType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static IndexType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final IndexType DEFAULT
-
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 thanHASH64
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 Detail
-
values
public static IndexType[] 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 (IndexType c : IndexType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IndexType 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
-
-