Class UniqueKeyPolicy

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

public final class UniqueKeyPolicy extends Object
Represents the unique key policy configuration for specifying uniqueness constraints on items in the container in the Azure Cosmos DB service.
  • Constructor Details

    • UniqueKeyPolicy

      public UniqueKeyPolicy()
      Instantiates a new Unique key policy.
  • Method Details

    • getUniqueKeys

      public List<UniqueKey> getUniqueKeys()
      Gets or sets container of UniqueKey that guarantee uniqueness of items in container in the Azure Cosmos DB service.
      Returns:
      the unique keys.
    • setUniqueKeys

      public UniqueKeyPolicy setUniqueKeys(List<UniqueKey> uniqueKeys)
      Unique keys unique key policy.
      Parameters:
      uniqueKeys - the unique keys
      Returns:
      the unique key policy
      Throws:
      IllegalArgumentException - thrown if an error occurs