你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

UniqueKey Class

  • java.lang.Object
    • com.azure.resourcemanager.cosmos.models.UniqueKey

Implements

public final class UniqueKey
implements JsonSerializable<UniqueKey>

The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

Constructor Summary

Constructor Description
UniqueKey()

Creates an instance of UniqueKey class.

Method Summary

Modifier and Type Method and Description
static UniqueKey fromJson(JsonReader jsonReader)

Reads an instance of UniqueKey from the JsonReader.

List<String> paths()

Get the paths property: List of paths must be unique for each document in the Azure Cosmos DB service.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

UniqueKey withPaths(List<String> paths)

Set the paths property: List of paths must be unique for each document in the Azure Cosmos DB service.

Methods inherited from java.lang.Object

Constructor Details

UniqueKey

public UniqueKey()

Creates an instance of UniqueKey class.

Method Details

fromJson

public static UniqueKey fromJson(JsonReader jsonReader)

Reads an instance of UniqueKey from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of UniqueKey if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the UniqueKey.

paths

public List<String> paths()

Get the paths property: List of paths must be unique for each document in the Azure Cosmos DB service.

Returns:

the paths value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withPaths

public UniqueKey withPaths(List<String> paths)

Set the paths property: List of paths must be unique for each document in the Azure Cosmos DB service.

Parameters:

paths - the paths value to set.

Returns:

the UniqueKey object itself.

Applies to