HashIndex Class

public class HashIndex extends Index

Represents a hash index in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
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);
</code></pre></p>

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);
</code></pre></p>

HashIndex(String jsonString)

Initializes a new instance of the HashIndex class with json string.

Method Summary

Modifier and Type Method and Description
DataType getDataType()

Gets data type.

int getPrecision()

Gets precision.

void setDataType(DataType dataType)

Sets data type.

void setPrecision(int precision)

Sets precision.

Inherited Members

Constructor Details

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);
</code></pre></p>

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);
</code></pre></p>

Parameters:

dataType - the data type.
precision - the precision.

HashIndex

public HashIndex(String jsonString)

Initializes a new instance of the HashIndex class with json string.

Parameters:

jsonString - the json string that represents the index.

Method Details

getDataType

public DataType getDataType()

Gets data type.

Returns:

the data type.

getPrecision

public int getPrecision()

Gets precision.

Returns:

the precision.

setDataType

public void setDataType(DataType dataType)

Sets data type.

Parameters:

dataType - the data type.

setPrecision

public void setPrecision(int precision)

Sets precision.

Parameters:

precision - the precision.

Applies to