|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rabbit.http.GeneralHeader
public class GeneralHeader
A class to handle general headers.
Field Summary | |
---|---|
protected ArrayList<Header> |
headers
The headers of this Header in order. |
Constructor Summary | |
---|---|
GeneralHeader()
Create a new HTTPHeader from scratch |
Method Summary | |
---|---|
void |
addHeader(Header h)
Add a new header. |
void |
addHeader(String type,
String value)
Add a new header. |
void |
copyHeader(GeneralHeader to)
Copy all headers in this header to the given header. |
protected void |
fillBuffer(StringBuilder sb)
Fill the given StringBuilder with text from this header. |
String |
getHeader(String type)
get the value of header type |
List<String> |
getHeaders(String type)
Get all headers of a specified type... |
void |
read(DataInput in)
Fill in this object with data from the given input. |
void |
removeHeader(String type)
removes a headerline from this header |
void |
removeValue(String value)
removes a header with the specified value |
void |
setExistingValue(String current,
String newValue)
Set a specified header |
void |
setHeader(String type,
String value)
Set or replaces a value for given type. |
int |
size()
Get the number of headers set in this header. |
String |
toString()
Get the text value of this header |
void |
write(DataOutput out)
Write this object to the given output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ArrayList<Header> headers
Constructor Detail |
---|
public GeneralHeader()
Method Detail |
---|
public int size()
public String toString()
toString
in class Object
protected void fillBuffer(StringBuilder sb)
public String getHeader(String type)
type
- the Header were intrested in.
public void setHeader(String type, String value)
type
- the type or category that we want to set.value
- the value we want to setpublic void setExistingValue(String current, String newValue)
current
- the type or category that we want to set.newValue
- the value we want to setpublic void addHeader(String type, String value)
type
- the type or category that we want to set.value
- the value we want to setpublic void addHeader(Header h)
h
- the Header to addpublic void removeHeader(String type)
type
- the type we want to removepublic void removeValue(String value)
value
- the value of the header we want to removepublic List<String> getHeaders(String type)
type
- the type of the headers to get, eg. "Cache-Control".public void copyHeader(GeneralHeader to)
to
- the GeneralHeader to add headers to.public void read(DataInput in) throws IOException
Storable
read
in interface Storable
IOException
public void write(DataOutput out) throws IOException
Storable
write
in interface Storable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |