@NotThreadSafe public class HeaderGroup extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
HeaderGroup()
Constructor for HeaderGroup.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(Header header)
Adds the given header to the group.
|
void |
clear()
Removes any contained headers.
|
java.lang.Object |
clone() |
boolean |
containsHeader(java.lang.String name)
Tests if headers with the given name are contained within this group.
|
HeaderGroup |
copy()
Returns a copy of this object
|
Header[] |
getAllHeaders()
Gets all of the headers contained within this group.
|
Header |
getCondensedHeader(java.lang.String name)
Gets a header representing all of the header values with the given name.
|
Header |
getFirstHeader(java.lang.String name)
Gets the first header with the given name.
|
Header[] |
getHeaders(java.lang.String name)
Gets all of the headers with the given name.
|
Header |
getLastHeader(java.lang.String name)
Gets the last header with the given name.
|
HeaderIterator |
iterator()
Returns an iterator over this group of headers.
|
HeaderIterator |
iterator(java.lang.String name)
Returns an iterator over the headers with a given name in this group.
|
void |
removeHeader(Header header)
Removes the given header.
|
void |
setHeaders(Header[] headers)
Sets all of the headers contained within this group overriding any
existing headers.
|
java.lang.String |
toString() |
void |
updateHeader(Header header)
Replaces the first occurence of the header with the same name.
|
public void clear()
public void addHeader(Header header)
header
- the header to addpublic void removeHeader(Header header)
header
- the header to removepublic void updateHeader(Header header)
header
- the new header that should replace the first header with the same
name if present in the list.public void setHeaders(Header[] headers)
headers
- the headers to setpublic Header getCondensedHeader(java.lang.String name)
Header name comparison is case insensitive.
name
- the name of the header(s) to getnull
if no
headers by the given name are presentpublic Header[] getHeaders(java.lang.String name)
Header name comparison is case insensitive.
name
- the name of the header(s) to getpublic Header getFirstHeader(java.lang.String name)
Header name comparison is case insensitive.
name
- the name of the header to getnull
public Header getLastHeader(java.lang.String name)
Header name comparison is case insensitive.
name
- the name of the header to getnull
public Header[] getAllHeaders()
public boolean containsHeader(java.lang.String name)
Header name comparison is case insensitive.
name
- the header name to test fortrue
if at least one header with the name is
contained, false
otherwisepublic HeaderIterator iterator()
public HeaderIterator iterator(java.lang.String name)
name
- the name of the headers over which to iterate, or
null
for all headerspublic HeaderGroup copy()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object