Package com.azure.cosmos.models
Class PartitionKeyDefinition
- java.lang.Object
-
- com.azure.cosmos.models.PartitionKeyDefinition
-
public final class PartitionKeyDefinition extends Object
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
Constructors Constructor Description PartitionKeyDefinition()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartitionKind
getKind()
Sets the partition algorithm used to calculate the partition id given a partition key.List<String>
getPaths()
Gets the item property paths for the partition key.PartitionKeyDefinitionVersion
getVersion()
Gets version.PartitionKeyDefinition
setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.PartitionKeyDefinition
setPaths(List<String> paths)
Sets the item property paths for the partition key.PartitionKeyDefinition
setVersion(PartitionKeyDefinitionVersion version)
Sets version.
-
-
-
Method Detail
-
getKind
public PartitionKind getKind()
Sets the partition algorithm used to calculate the partition id given a partition key.- Returns:
- the partition algorithm.
-
setKind
public PartitionKeyDefinition setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.- Parameters:
kind
- the partition algorithm.- Returns:
- this PartitionKeyDefinition.
-
getVersion
public PartitionKeyDefinitionVersion getVersion()
Gets version.- Returns:
- the
PartitionKeyDefinitionVersion
-
setVersion
public PartitionKeyDefinition setVersion(PartitionKeyDefinitionVersion version)
Sets version.- Parameters:
version
- the version- Returns:
- the version
-
getPaths
public List<String> getPaths()
Gets the item property paths for the partition key.- Returns:
- the paths to the item properties that form the partition key.
-
setPaths
public PartitionKeyDefinition setPaths(List<String> paths)
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
-
-