Package com.azure.cosmos.models
Class PartitionKey
java.lang.Object
com.azure.cosmos.models.PartitionKey
Represents a partition key value in the Azure Cosmos DB database service. A
partition key identifies the partition where the item is stored in.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PartitionKey
Partition key that represents no partition key. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Overrides the Equal operator for object comparisons between two instances ofPartitionKey
static PartitionKey
fromItem
(Map<String, Object> item, PartitionKeyDefinition partitionKeyDefinition) Returns the PartitionKey extracted from the itemstatic PartitionKey
fromObjectArray
(Object[] values, boolean strict) Returns the PartitionKey from an array of objects that is generated by PartitionKeyInternalint
hashCode()
toString()
Serialize the PartitionKey object to a JSON string.
-
Field Details
-
NONE
Partition key that represents no partition key.
-
-
Constructor Details
-
PartitionKey
Constructor. CREATE a new instance of the PartitionKey object.- Parameters:
key
- the value of the partition key.
-
-
Method Details
-
toString
Serialize the PartitionKey object to a JSON string. -
fromObjectArray
Returns the PartitionKey from an array of objects that is generated by PartitionKeyInternal- Parameters:
values
- The object array of values to construct the PartitionKey withstrict
- The boolean value for if to use strict on object types- Returns:
- The PartitionKey
-
fromItem
public static PartitionKey fromItem(Map<String, Object> item, PartitionKeyDefinition partitionKeyDefinition) Returns the PartitionKey extracted from the item- Parameters:
item
- The JsonSerializable object to get the PartitionKey value frompartitionKeyDefinition
- The PartitionKeyDefinition to use to extract the PartitionKey value- Returns:
- The PartitionKey
-
equals
Overrides the Equal operator for object comparisons between two instances ofPartitionKey
-
hashCode
public int hashCode()
-