public class Header
extends java.lang.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(java.lang.String name,
java.lang.String value)
Create a Header instance using the provided name and value.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(java.lang.String value)
Add a new value to the end of the Header.
|
java.lang.String |
getName()
Gets the header name.
|
java.lang.String |
getValue()
Gets the value of this
Header . |
java.lang.String[] |
getValues()
Gets the comma separated value as an array.
|
java.lang.String |
toString()
Gets the String representation of the header.
|
public Header(java.lang.String name, java.lang.String value)
name
- the name of the header.value
- the value of the header.java.lang.NullPointerException
- if name
is null.public java.lang.String getName()
Header
public java.lang.String getValue()
Header
.public java.lang.String[] getValues()
Header
that are separated by a commapublic void addValue(java.lang.String value)
value
- the value to addpublic java.lang.String toString()
toString
in class java.lang.Object