Package com.azure.cosmos.models
Class PartitionKeyBuilder
java.lang.Object
com.azure.cosmos.models.PartitionKeyBuilder
Builder for partition keys.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(boolean value) Adds partition value of type booleanadd
(double value) Adds partition value of type doubleAdds partition value of type stringDeprecated.PartitionKey.None value should only be used with PartitionKey constructor.Deprecated.Null value should only be used with PartitionKey constructor.build()
Builds a new instance of the type PartitionKey with the specified Partition Key values.
-
Constructor Details
-
PartitionKeyBuilder
public PartitionKeyBuilder()Constructor. CREATE a new instance of the PartitionKeyBuilder object.
-
-
Method Details
-
add
Adds partition value of type string- Parameters:
value
- The value of type string to be used as partition key- Returns:
- The current PartitionKeyBuilder object
-
add
Adds partition value of type double- Parameters:
value
- The value of type double to be used as partition key- Returns:
- The current PartitionKeyBuilder object
-
add
Adds partition value of type boolean- Parameters:
value
- The value of type boolean to be used as partition key- Returns:
- The current PartitionKeyBuilder object
-
addNullValue
Deprecated.Null value should only be used with PartitionKey constructor.Adds a null partition key value- Returns:
- The current PartitionKeyBuilder object
-
addNoneValue
Deprecated.PartitionKey.None value should only be used with PartitionKey constructor.Adds a None Partition Key value to the path. An error will be raised if used with other paths.- Returns:
- The current PartitionKeyBuilder object
-
build
Builds a new instance of the type PartitionKey with the specified Partition Key values.- Returns:
- PartitionKey object
- Throws:
IllegalStateException
- when using PartitionKey.None with other values
-