Compartilhar via


HashIndex Class

public final 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.

HashIndex(DataType dataType, int precision)

Initializes a new instance of the HashIndex class with specified DataType and precision.

HashIndex(String jsonString)

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

HashIndex(JSONObject jsonObject)

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

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.

Methods inherited from Index

Methods inherited from JsonSerializable

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

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);

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.

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.

HashIndex

public HashIndex(JSONObject jsonObject)

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

Parameters:

jsonObject - the json object 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