Package org.apache.http.message
Class BasicHeaderElement
- java.lang.Object
-
- org.apache.http.message.BasicHeaderElement
-
- All Implemented Interfaces:
java.lang.Cloneable
,HeaderElement
public class BasicHeaderElement extends java.lang.Object implements HeaderElement, java.lang.Cloneable
Basic implementation ofHeaderElement
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description BasicHeaderElement(java.lang.String name, java.lang.String value)
Constructor with name and value.BasicHeaderElement(java.lang.String name, java.lang.String value, NameValuePair[] parameters)
Constructor with name, value and parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
boolean
equals(java.lang.Object object)
java.lang.String
getName()
Returns header element name.NameValuePair
getParameter(int index)
Returns parameter with the given index.NameValuePair
getParameterByName(java.lang.String name)
Returns the first parameter with the given name.int
getParameterCount()
Returns the total count of parameters.NameValuePair[]
getParameters()
Returns an array of name / value pairs.java.lang.String
getValue()
Returns header element value.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
BasicHeaderElement
public BasicHeaderElement(java.lang.String name, java.lang.String value, NameValuePair[] parameters)
Constructor with name, value and parameters.- Parameters:
name
- header element namevalue
- header element value. May benull
parameters
- header element parameters. May benull
. Parameters are copied by reference, not by value
-
BasicHeaderElement
public BasicHeaderElement(java.lang.String name, java.lang.String value)
Constructor with name and value.- Parameters:
name
- header element namevalue
- header element value. May benull
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:HeaderElement
Returns header element name.- Specified by:
getName
in interfaceHeaderElement
- Returns:
- header element name
-
getValue
public java.lang.String getValue()
Description copied from interface:HeaderElement
Returns header element value.- Specified by:
getValue
in interfaceHeaderElement
- Returns:
- header element value
-
getParameters
public NameValuePair[] getParameters()
Description copied from interface:HeaderElement
Returns an array of name / value pairs.- Specified by:
getParameters
in interfaceHeaderElement
- Returns:
- array of name / value pairs
-
getParameterCount
public int getParameterCount()
Description copied from interface:HeaderElement
Returns the total count of parameters.- Specified by:
getParameterCount
in interfaceHeaderElement
- Returns:
- parameter count
-
getParameter
public NameValuePair getParameter(int index)
Description copied from interface:HeaderElement
Returns parameter with the given index.- Specified by:
getParameter
in interfaceHeaderElement
- Parameters:
index
- index- Returns:
- name / value pair
-
getParameterByName
public NameValuePair getParameterByName(java.lang.String name)
Description copied from interface:HeaderElement
Returns the first parameter with the given name.- Specified by:
getParameterByName
in interfaceHeaderElement
- Parameters:
name
- parameter name- Returns:
- name / value pair
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Throws:
java.lang.CloneNotSupportedException
-
-