Sdílet prostřednictvím


PartitionKey Class

  • java.lang.Object
    • com.microsoft.azure.cosmosdb.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(final Object key)

Constructor. Create a new instance of the PartitionKey object.

Method Summary

Modifier and Type Method and Description
boolean equals(Object other)

Overrides the Equal operator for object comparisons between two instances of PartitionKey

PartitionKey FromJsonString(String jsonString)

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

PartitionKeyInternal getInternalPartitionKey()
String toString()

Serialize the PartitionKey object to a JSON string.

Constructor Details

PartitionKey

public PartitionKey(final Object key)

Constructor. Create a new instance of the PartitionKey object.

Parameters:

key - the value of the partition key.

Method Details

equals

public boolean equals(Object other)

Overrides the Equal operator for object comparisons between two instances of PartitionKey

Parameters:

other - The object to compare with.

Returns:

True if two object instance are considered equal.

FromJsonString

public static PartitionKey FromJsonString(String jsonString)

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

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.

Returns:

the string representation of this PartitionKey object.

Applies to