CosmosAdditionalHeaderName Class

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

public final class CosmosAdditionalHeaderName

Defines the set of additional headers that can be set on a CosmosClientBuilder via CosmosClientBuilder#additionalHeaders(java.util.Map).

Only headers with RNTBD encoding support are included, ensuring consistent behavior across both Gateway mode (HTTP) and Direct mode (RNTBD binary protocol).

This class uses the non-exhaustive final class pattern (rather than Java enum) for binary compatibility when new header names are added in future releases. See Azure SDK Java Guidelines - Enumerations.

Field Summary

Modifier and Type Field and Description
static final CosmosAdditionalHeaderName WORKLOAD_ID

The workload ID header (x-ms-cosmos-workload-id).

Method Summary

Modifier and Type Method and Description
boolean equals(Object obj)
String getHeaderName()

Gets the canonical HTTP header name string (e.g., "x-ms-cosmos-workload-id").

int hashCode()
String toString()

Methods inherited from java.lang.Object

Field Details

WORKLOAD_ID

public static final CosmosAdditionalHeaderName WORKLOAD_ID

The workload ID header (x-ms-cosmos-workload-id).

Valid values: a string representation of an integer (e.g., "15"). The service accepts values in the range 1-50 for Azure Monitor metrics attribution. The SDK validates that the value is a valid integer but does not enforce range limits - range validation is the backend's responsibility.

Method Details

equals

public boolean equals(Object obj)

Overrides:

CosmosAdditionalHeaderName.equals(Object obj)

Parameters:

obj

getHeaderName

public String getHeaderName()

Gets the canonical HTTP header name string (e.g., "x-ms-cosmos-workload-id").

Returns:

the header name string

hashCode

public int hashCode()

Overrides:

CosmosAdditionalHeaderName.hashCode()

toString

public String toString()

Overrides:

CosmosAdditionalHeaderName.toString()

Applies to