|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.message.HeaderGroup
public class HeaderGroup
A class for combining a set of headers. This class allows for multiple headers with the same name and keeps track of the order in which headers were added.
Constructor Summary | |
---|---|
HeaderGroup()
Constructor for HeaderGroup. |
Method Summary | |
---|---|
void |
addHeader(Header header)
Adds the given header to the group. |
void |
clear()
Removes any contained headers. |
Object |
clone()
|
boolean |
containsHeader(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(String name)
Gets a header representing all of the header values with the given name. |
Header |
getFirstHeader(String name)
Gets the first header with the given name. |
Header[] |
getHeaders(String name)
Gets all of the headers with the given name. |
Header |
getLastHeader(String name)
Gets the last header with the given name. |
HeaderIterator |
iterator()
Returns an iterator over this group of headers. |
HeaderIterator |
iterator(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. |
String |
toString()
|
void |
updateHeader(Header header)
Replaces the first occurence of the header with the same name. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HeaderGroup()
Method Detail |
---|
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(String name)
Header name comparison is case insensitive.
name
- the name of the header(s) to get
null
if no
headers by the given name are presentpublic Header[] getHeaders(String name)
Header name comparison is case insensitive.
name
- the name of the header(s) to get
public Header getFirstHeader(String name)
Header name comparison is case insensitive.
name
- the name of the header to get
null
public Header getLastHeader(String name)
Header name comparison is case insensitive.
name
- the name of the header to get
null
public Header[] getAllHeaders()
public boolean containsHeader(String name)
Header name comparison is case insensitive.
name
- the header name to test for
true
if at least one header with the name is
contained, false
otherwisepublic HeaderIterator iterator()
public HeaderIterator iterator(String name)
name
- the name of the headers over which to iterate, or
null
for all headers
public HeaderGroup copy()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |