Package com.azure.cosmos.models
Class PartitionKeyDefinition
java.lang.Object
com.azure.cosmos.models.PartitionKeyDefinition
Represents a partition key definition in the Azure Cosmos DB database service. A partition key definition
specifies which
item property is used as the partition key in a container that has multiple partitions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKind()
Sets the partition algorithm used to calculate the partition id given a partition key.getPaths()
Gets the item property paths for the partition key.Gets version.setKind
(PartitionKind kind) Sets the partition algorithm used to calculate the partition id given a partition key.Sets the item property paths for the partition key.setVersion
(PartitionKeyDefinitionVersion version) Sets version.
-
Constructor Details
-
PartitionKeyDefinition
public PartitionKeyDefinition()Constructor. Creates a new instance of the PartitionKeyDefinition object.
-
-
Method Details
-
getKind
Sets the partition algorithm used to calculate the partition id given a partition key.- Returns:
- the partition algorithm.
-
setKind
Sets the partition algorithm used to calculate the partition id given a partition key.- Parameters:
kind
- the partition algorithm.- Returns:
- this PartitionKeyDefinition.
-
getVersion
Gets version.- Returns:
- the
PartitionKeyDefinitionVersion
-
setVersion
Sets version.- Parameters:
version
- the version- Returns:
- the version
-
getPaths
Gets the item property paths for the partition key.- Returns:
- the paths to the item properties that form the partition key.
-
setPaths
Sets the item property paths for the partition key.- Parameters:
paths
- the paths to item properties that form the partition key.- Returns:
- this PartitionKeyDefinition.
- Throws:
IllegalArgumentException
- thrown if an error occurs
-