Partager via


UniqueKeyPolicy Class

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

Implements

public final class UniqueKeyPolicy
implements JsonSerializable<UniqueKeyPolicy>

The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.

Constructor Summary

Constructor Description
UniqueKeyPolicy()

Creates an instance of UniqueKeyPolicy class.

Method Summary

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

Reads an instance of UniqueKeyPolicy from the JsonReader.

JsonWriter toJson(JsonWriter jsonWriter)
List<UniqueKey> uniqueKeys()

Get the uniqueKeys property: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

void validate()

Validates the instance.

UniqueKeyPolicy withUniqueKeys(List<UniqueKey> uniqueKeys)

Set the uniqueKeys property: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

Methods inherited from java.lang.Object

Constructor Details

UniqueKeyPolicy

public UniqueKeyPolicy()

Creates an instance of UniqueKeyPolicy class.

Method Details

fromJson

public static UniqueKeyPolicy fromJson(JsonReader jsonReader)

Reads an instance of UniqueKeyPolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of UniqueKeyPolicy 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 UniqueKeyPolicy.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

uniqueKeys

public List uniqueKeys()

Get the uniqueKeys property: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

Returns:

the uniqueKeys value.

validate

public void validate()

Validates the instance.

withUniqueKeys

public UniqueKeyPolicy withUniqueKeys(List uniqueKeys)

Set the uniqueKeys property: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.

Parameters:

uniqueKeys - the uniqueKeys value to set.

Returns:

the UniqueKeyPolicy object itself.

Applies to