public class Header extends Object
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 and Description |
---|
Header(String name,
List<String> values)
Create a Header instance using the provided name and values.
|
Header(String name,
String... values)
Create a Header instance using the provided name and values.
|
Header(String name,
String value)
Create a Header instance using the provided name and value.
|
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.
|
public Header(String name, String value)
name
- the name of the header.value
- the value of the header.NullPointerException
- if name
is null.public Header(String name, String... values)
name
- the name of the header.values
- the values of the header.NullPointerException
- if name
is null.public Header(String name, List<String> values)
name
- the name of the header.values
- the values of the header.NullPointerException
- if name
is null.public String getValue()
Header
, taking into account all values provided.public String[] getValues()
Header
that are separated by a commapublic List<String> getValuesList()
public void addValue(String value)
value
- the value to addCopyright © 2021 Microsoft Corporation. All rights reserved.