Header Class
- java.
lang. Object - com.
azure. core. util. Header
- com.
public class Header
Represents a single header to be set on a request.
If multiple header values are added to a request with the same name (case-insensitive), then the values will be appended at the end of the same Header with commas separating them.
Constructor Summary
Constructor | Description |
---|---|
Header(String name, String value) |
Create a Header instance using the provided name and value. |
Header(String name, String[] values) |
Create a Header instance using the provided name and values. |
Header(String name, List<String> values) |
Create a Header instance using the provided name and values. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addValue(String value)
Add a new value to the end of the Header. |
String |
getName()
Gets the header name. |
String |
getValue()
Gets the combined, comma-separated value of this Header, taking into account all values provided. |
String[] |
getValues()
Gets the comma separated value as an array. |
List<String> |
getValuesList()
Returns all values associated with this header, represented as an unmodifiable list of strings. |
String |
toString()
Gets the String representation of the header. |
Methods inherited from java.lang.Object
Constructor Details
Header
public Header(String name, String value)
Create a Header instance using the provided name and value.
Parameters:
Header
public Header(String name, String[] values)
Create a Header instance using the provided name and values.
Parameters:
Header
public Header(String name, List
Create a Header instance using the provided name and values.
Parameters:
Method Details
addValue
public void addValue(String value)
Add a new value to the end of the Header.
Parameters:
getName
getValue
public String getValue()
Gets the combined, comma-separated value of this Header, taking into account all values provided.
Returns:
getValues
public String[] getValues()
Gets the comma separated value as an array. Changes made to this array will not be reflected in the headers.
Returns:
getValuesList
public List
Returns all values associated with this header, represented as an unmodifiable list of strings.
Returns:
toString
public String toString()
Gets the String representation of the header.
Overrides:
Header.toString()Returns: