org.apache.http.message
Class BasicHeader

java.lang.Object
  extended by org.apache.http.message.BasicHeader
All Implemented Interfaces:
Serializable, Cloneable, Header, NameValuePair

@Contract(threading=IMMUTABLE)
public class BasicHeader
extends Object
implements Header, Cloneable, Serializable

Implements a basic Header.

Since:
4.0
See Also:
Serialized Form

Constructor Summary
BasicHeader(String name, String value)
          Constructs with name and value.
 
Method Summary
 Object clone()
           
 HeaderElement[] getElements()
          Parses the value.
 String getName()
          Gets the name of this pair.
 String getValue()
          Gets the value of this pair.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicHeader

public BasicHeader(String name,
                   String value)
Constructs with name and value.

Parameters:
name - the header name
value - the header value
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getElements

public HeaderElement[] getElements()
                            throws ParseException
Description copied from interface: Header
Parses the value.

Specified by:
getElements in interface Header
Returns:
an array of HeaderElement entries, may be empty, but is never null
Throws:
ParseException - in case of a parsing error

getName

public String getName()
Description copied from interface: NameValuePair
Gets the name of this pair.

Specified by:
getName in interface NameValuePair
Returns:
the name of this pair, never null.

getValue

public String getValue()
Description copied from interface: NameValuePair
Gets the value of this pair.

Specified by:
getValue in interface NameValuePair
Returns:
the value of this pair, may be null.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.