com.microsoft.azure.documentdb.PartitionKey Maven / Gradle / Ivy
package com.microsoft.azure.documentdb;
import java.util.ArrayList;
import org.json.JSONArray;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.microsoft.azure.documentdb.internal.Utils;
import com.microsoft.azure.documentdb.internal.routing.PartitionKeyInternal;
/**
* Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition
* where the document is stored in.
*/
public class PartitionKey {
private final Object[] key;
private String keyString;
private PartitionKeyInternal internalPartitionKey;
/**
* Constructor. Create a new instance of the PartitionKey object.
*
* @param key the value of the partition key.
*/
public PartitionKey(final Object key) {
this.key = new Object[] {key};
this.internalPartitionKey = PartitionKeyInternal.fromObjectArray(new ArrayList