Compartilhar via


PartitionKey Class

  • java.lang.Object
    • com.microsoft.azure.documentdb.PartitionKey

public class PartitionKey

Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the document is stored in.

Constructor Summary

Constructor Description
PartitionKey(Object key)

Constructor.

Method Summary

Modifier and Type Method and Description
static PartitionKey FromJsonString(String jsonString)

Create a new instance of the PartitionKey object from a serialized JSON string.

com.microsoft.azure.documentdb.internal.routing.PartitionKeyInternal getInternalPartitionKey()
java.lang.String toString()

Serialize the PartitionKey object to a JSON string.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

PartitionKey

public PartitionKey(Object key)

Constructor. Create a new instance of the PartitionKey object.

Parameters:

key - the value of the partition key.

Method Details

FromJsonString

public static PartitionKey FromJsonString(String jsonString)

Create a new instance of the PartitionKey object from a serialized JSON string.

Parameters:

jsonString - the JSON string representation of this PartitionKey object.

Returns:

the PartitionKey instance.

getInternalPartitionKey

public PartitionKeyInternal getInternalPartitionKey()

toString

public String toString()

Serialize the PartitionKey object to a JSON string.

Overrides:

PartitionKey.toString()

Returns:

the string representation of this PartitionKey object.

Applies to