PartitionKey Class
- java.
lang. Object - com.
azure. cosmos. models. PartitionKey
- com.
public class 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 Type | Field and Description |
---|---|
static final
Partition |
NONE
Partition key that represents no partition key. |
Constructor Summary
Constructor | Description |
---|---|
PartitionKey(Object key) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Overrides the Equal operator for object comparisons between two instances of PartitionKey |
static
Partition |
fromItem(Map<String,Object> item, PartitionKeyDefinition partitionKeyDefinition)
Returns the Partition |
static
Partition |
fromObjectArray(Object[] values, boolean strict)
Returns the Partition |
int | hashCode() |
String |
toString()
Serialize the Partition |
Methods inherited from java.lang.Object
Field Details
NONE
public static final PartitionKey NONE
Partition key that represents no partition key.
Constructor Details
PartitionKey
public PartitionKey(Object key)
Constructor. CREATE a new instance of the PartitionKey object.
Parameters:
Method Details
equals
public boolean equals(Object other)
Overrides the Equal operator for object comparisons between two instances of PartitionKey
Overrides:
PartitionKey.equals(Object other)Parameters:
Returns:
fromItem
public static PartitionKey fromItem(Map
Returns the PartitionKey extracted from the item
Parameters:
Returns:
fromObjectArray
public static PartitionKey fromObjectArray(Object[] values, boolean strict)
Returns the PartitionKey from an array of objects that is generated by PartitionKeyInternal
Parameters:
Returns:
hashCode
public int hashCode()
Overrides:
PartitionKey.hashCode()toString
public String toString()
Serialize the PartitionKey object to a JSON string.
Overrides:
PartitionKey.toString()Returns: