CosmosAdditionalHeaderName Class
- java.
lang. Object - com.
azure. cosmos. models. CosmosAdditionalHeaderName
- com.
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
Cosmos |
WORKLOAD_ID
The workload ID header ( |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| boolean | equals(Object obj) |
| String |
getHeaderName()
Gets the canonical HTTP header name string (e. |
| 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:
getHeaderName
public String getHeaderName()
Gets the canonical HTTP header name string (e.g., "x-ms-cosmos-workload-id").
Returns:
hashCode
public int hashCode()
Overrides:
CosmosAdditionalHeaderName.hashCode()toString
public String toString()
Overrides:
CosmosAdditionalHeaderName.toString()