PartitionKeyBuilder Class

  • java.lang.Object
    • com.azure.cosmos.models.PartitionKeyBuilder

public final class PartitionKeyBuilder

Builder for partition keys.

Constructor Summary

Constructor Description
PartitionKeyBuilder()

Constructor.

Method Summary

Modifier and Type Method and Description
PartitionKeyBuilder add(boolean value)

Adds partition value of type boolean

PartitionKeyBuilder add(double value)

Adds partition value of type double

PartitionKeyBuilder add(String value)

Adds partition value of type string

PartitionKeyBuilder addNoneValue()

Deprecated

PartitionKey.None value should only be used with PartitionKey constructor.

Adds a None Partition Key value to the path.

PartitionKeyBuilder addNullValue()

Deprecated

Null value should only be used with PartitionKey constructor.

Adds a null partition key value

PartitionKey build()

Builds a new instance of the type PartitionKey with the specified Partition Key values.

Methods inherited from java.lang.Object

Constructor Details

PartitionKeyBuilder

public PartitionKeyBuilder()

Constructor. CREATE a new instance of the PartitionKeyBuilder object.

Method Details

add

public PartitionKeyBuilder add(boolean value)

Adds partition value of type boolean

Parameters:

value - The value of type boolean to be used as partition key

Returns:

The current PartitionKeyBuilder object

add

public PartitionKeyBuilder add(double value)

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

public PartitionKeyBuilder add(String value)

Adds partition value of type string

Parameters:

value - The value of type string to be used as partition key

Returns:

The current PartitionKeyBuilder object

addNoneValue

@Deprecated
public PartitionKeyBuilder 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

addNullValue

@Deprecated
public PartitionKeyBuilder addNullValue()

Deprecated

Null value should only be used with PartitionKey constructor.

Adds a null partition key value

Returns:

The current PartitionKeyBuilder object

build

public PartitionKey build()

Builds a new instance of the type PartitionKey with the specified Partition Key values.

Returns:

PartitionKey object

Applies to