Package com.azure.data.cosmos
Class PartitionKeyDefinition
- java.lang.Object
-
- com.azure.data.cosmos.JsonSerializable
-
- com.azure.data.cosmos.PartitionKeyDefinition
-
public final class PartitionKeyDefinition extends JsonSerializable
Represents a partition key definition in the Azure Cosmos DB database service. A partition key definition specifies which document property is used as the partition key in a collection 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
kind()
Sets the partition algorithm used to calculate the partition id given a partition key.PartitionKeyDefinition
kind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.List<String>
paths()
Gets the document property paths for the partition key.PartitionKeyDefinition
paths(List<String> paths)
Sets the document property paths for the partition key.PartitionKeyDefinitionVersion
version()
PartitionKeyDefinition
version(PartitionKeyDefinitionVersion version)
-
Methods inherited from class com.azure.data.cosmos.JsonSerializable
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
-
-
-
-
Method Detail
-
kind
public PartitionKind kind()
Sets the partition algorithm used to calculate the partition id given a partition key.- Returns:
- the partition algorithm.
-
kind
public PartitionKeyDefinition kind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.- Parameters:
kind
- the partition algorithm.- Returns:
- this PartitionKeyDefinition.
-
version
public PartitionKeyDefinitionVersion version()
-
version
public PartitionKeyDefinition version(PartitionKeyDefinitionVersion version)
-
paths
public List<String> paths()
Gets the document property paths for the partition key.- Returns:
- the paths to the document properties that form the partition key.
-
paths
public PartitionKeyDefinition paths(List<String> paths)
Sets the document property paths for the partition key.- Parameters:
paths
- the paths to document properties that form the partition key.- Returns:
- this PartitionKeyDefinition.
-
-