PartitionKeyDefinition Class
- java.
lang. Object - JsonSerializable
- com.
microsoft. azure. cosmosdb. PartitionKeyDefinition
- com.
public 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
Constructor | Description |
---|---|
PartitionKeyDefinition() |
Constructor. Creates a new instance of the PartitionKeyDefinition object. |
PartitionKeyDefinition(String jsonString) |
Constructor. Creates a new instance of the PartitionKeyDefinition object from a JSON string. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Partition |
getKind()
Sets the partition algorithm used to calculate the partition id given a partition key. |
List<String> |
getPaths()
Gets the document property paths for the partition key. |
Partition |
getVersion() |
void |
setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key. |
void |
setPaths(List<String> paths)
Sets the document property paths for the partition key. |
void | setVersion(PartitionKeyDefinitionVersion version) |
Inherited Members
Constructor Details
PartitionKeyDefinition
public PartitionKeyDefinition()
Constructor. Creates a new instance of the PartitionKeyDefinition object.
PartitionKeyDefinition
public PartitionKeyDefinition(String jsonString)
Constructor. Creates a new instance of the PartitionKeyDefinition object from a JSON string.
Parameters:
Method Details
getKind
public PartitionKind getKind()
Sets the partition algorithm used to calculate the partition id given a partition key.
Returns:
getPaths
public List
Gets the document property paths for the partition key.
Returns:
getVersion
public PartitionKeyDefinitionVersion getVersion()
setKind
public void setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.
Parameters:
setPaths
public void setPaths(List
Sets the document property paths for the partition key.
Parameters:
setVersion
public void setVersion(PartitionKeyDefinitionVersion version)
Parameters:
Applies to
Azure SDK for Java