Class PartitionKey

java.lang.Object
com.azure.cosmos.models.PartitionKey

public class PartitionKey extends Object
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 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:
      key - the value of the partition key.
  • Method Details

    • toString

      public String toString()
      Serialize the PartitionKey object to a JSON string.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this PartitionKey object.
    • equals

      public boolean equals(Object other)
      Overrides the Equal operator for object comparisons between two instances of PartitionKey
      Overrides:
      equals in class Object
      Parameters:
      other - The object to compare with.
      Returns:
      True if two object instance are considered equal.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object