Package com.azure.data.cosmos
Class HashIndex
- java.lang.Object
-
- com.azure.data.cosmos.JsonSerializable
-
- com.azure.data.cosmos.Index
-
- com.azure.data.cosmos.HashIndex
-
public final class HashIndex extends Index
Represents a hash index in the Azure Cosmos DB database service.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataType
dataType()
Gets data type.HashIndex
dataType(DataType dataType)
Sets data type.int
precision()
Gets precision.HashIndex
precision(int precision)
Sets precision.-
Methods inherited from class com.azure.data.cosmos.JsonSerializable
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
-
-
-
-
Constructor Detail
-
HashIndex
public HashIndex(DataType dataType)
Specifies an instance of HashIndex class with specified DataType.Here is an example to instantiate HashIndex class passing in the DataType:
HashIndex hashIndex = new HashIndex(DataType.STRING);
- Parameters:
dataType
- the data type.
-
HashIndex
public HashIndex(DataType dataType, int precision)
Initializes a new instance of the HashIndex class with specified DataType and precision.Here is an example to instantiate HashIndex class passing in the DataType:
HashIndex hashIndex = new HashIndex(DataType.STRING, 3);
- Parameters:
dataType
- the data type.precision
- the precision.
-
-
Method Detail
-
dataType
public DataType dataType()
Gets data type.- Returns:
- the data type.
-
dataType
public HashIndex dataType(DataType dataType)
Sets data type.- Parameters:
dataType
- the data type.- Returns:
- the Hash Index.
-
precision
public int precision()
Gets precision.- Returns:
- the precision.
-
precision
public HashIndex precision(int precision)
Sets precision.- Parameters:
precision
- the precision.- Returns:
- the Hash Index.
-
-