Class ContainerPartitionKey
java.lang.Object
com.azure.resourcemanager.cosmos.models.ContainerPartitionKey
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ContainerPartitionKey>
public final class ContainerPartitionKey
extends Object
implements com.azure.json.JsonSerializable<ContainerPartitionKey>
The configuration of the partition key to be used for partitioning data into multiple partitions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerPartitionKey
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of ContainerPartitionKey from the JsonReader.kind()
Get the kind property: Indicates the kind of algorithm used for partitioning.paths()
Get the paths property: List of paths using which data within the container can be partitioned.Get the systemKey property: Indicates if the container is using a system generated partition key.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.version()
Get the version property: Indicates the version of the partition key definition.withKind
(PartitionKind kind) Set the kind property: Indicates the kind of algorithm used for partitioning.Set the paths property: List of paths using which data within the container can be partitioned.withVersion
(Integer version) Set the version property: Indicates the version of the partition key definition.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ContainerPartitionKey
public ContainerPartitionKey()Creates an instance of ContainerPartitionKey class.
-
-
Method Details
-
paths
Get the paths property: List of paths using which data within the container can be partitioned.- Returns:
- the paths value.
-
withPaths
Set the paths property: List of paths using which data within the container can be partitioned.- Parameters:
paths
- the paths value to set.- Returns:
- the ContainerPartitionKey object itself.
-
kind
Get the kind property: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create.- Returns:
- the kind value.
-
withKind
Set the kind property: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create.- Parameters:
kind
- the kind value to set.- Returns:
- the ContainerPartitionKey object itself.
-
version
Get the version property: Indicates the version of the partition key definition.- Returns:
- the version value.
-
withVersion
Set the version property: Indicates the version of the partition key definition.- Parameters:
version
- the version value to set.- Returns:
- the ContainerPartitionKey object itself.
-
systemKey
Get the systemKey property: Indicates if the container is using a system generated partition key.- Returns:
- the systemKey value.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<ContainerPartitionKey>
- Throws:
IOException
-
fromJson
public static ContainerPartitionKey fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ContainerPartitionKey from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of ContainerPartitionKey if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException
- If an error occurs while reading the ContainerPartitionKey.
-