PartitionKeyDefinition Class

  • java.lang.Object
    • com.azure.cosmos.models.PartitionKeyDefinition

public final class 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

Constructor Description
PartitionKeyDefinition()

Constructor.

Method Summary

Modifier and Type Method and 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.

Methods inherited from java.lang.Object

Constructor Details

PartitionKeyDefinition

public PartitionKeyDefinition()

Constructor. Creates a new instance of the PartitionKeyDefinition object.

Method Details

getKind

public PartitionKind getKind()

Sets the partition algorithm used to calculate the partition id given a partition key.

Returns:

the partition algorithm.

getPaths

public List getPaths()

Gets the item property paths for the partition key.

Returns:

the paths to the item properties that form the partition key.

getVersion

public PartitionKeyDefinitionVersion getVersion()

Gets version.

Returns:

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.

setPaths

public PartitionKeyDefinition setPaths(List 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.

setVersion

public PartitionKeyDefinition setVersion(PartitionKeyDefinitionVersion version)

Sets version.

Parameters:

version - the version

Returns:

the version

Applies to