HTTPClient
Class HttpHeaderElement
java.lang.Object
|
+--HTTPClient.HttpHeaderElement
- public class HttpHeaderElement
- extends java.lang.Object
This class holds a description of an http header element. It is used
by Util.parseHeader.
- See Also:
Util.parseHeader(java.lang.String),
Util.getElement(java.util.Vector, java.lang.String),
Util.assembleHeader(java.util.Vector)
| Type | Method |
void |
appendTo(java.lang.StringBuffer buf)
Append this header element to the given buffer. |
boolean |
equals(java.lang.Object obj)
Two elements are equal if they have the same name. |
java.lang.String |
getName()
|
NVPair[] |
getParams()
|
java.lang.String |
getValue()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HttpHeaderElement
public HttpHeaderElement(java.lang.String name)
- Construct an element with the given name. The value and parameters
are set to null. This can be used when a dummy element is constructed
for comparison or retrieval purposes.
- Parameters:
name - the name of the element
HttpHeaderElement
public HttpHeaderElement(java.lang.String name,
java.lang.String value,
NVPair[] params)
- Parameters:
name - the first token in the elementvalue - the value part, or nullparams - the parameters
getName
public java.lang.String getName()
- Returns:
- the name
getValue
public java.lang.String getValue()
- Returns:
- the value
getParams
public NVPair[] getParams()
- Returns:
- the parameters
equals
public boolean equals(java.lang.Object obj)
- Two elements are equal if they have the same name. The comparison is
case-insensitive.
- Overrides:
equals in class java.lang.Object
- Parameters:
obj - the object to compare with- Returns:
- true if obj is an HttpHeaderElement with the same
name as this element.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- a string containing the HttpHeaderElement formatted as it
would appear in a header
appendTo
public void appendTo(java.lang.StringBuffer buf)
- Append this header element to the given buffer. This is basically a
more efficient version of
toString() for assembling
multiple elements.
- Parameters:
buf - the StringBuffer to append this header to- See Also:
toString()