Package org.apache.hc.core5.http.message
Class BasicHeader
- java.lang.Object
-
- org.apache.hc.core5.http.message.BasicHeader
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Header,NameValuePair
@Contract(threading=IMMUTABLE) public class BasicHeader extends java.lang.Object implements Header, java.lang.Cloneable, java.io.Serializable
ImmutableHeader.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate booleansensitiveprivate static longserialVersionUIDprivate java.lang.Stringvalue
-
Constructor Summary
Constructors Constructor Description BasicHeader(java.lang.String name, java.lang.Object value)Default constructorBasicHeader(java.lang.String name, java.lang.Object value, boolean sensitive)Constructor with sensitivity flag
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicHeaderclone()java.lang.StringgetName()Gets the name of this pair.java.lang.StringgetValue()Gets the value of this pair.booleanisSensitive()Returnstrueif the header should be considered sensitive.java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private final java.lang.String name
-
sensitive
private final boolean sensitive
-
value
private final java.lang.String value
-
-
Constructor Detail
-
BasicHeader
public BasicHeader(java.lang.String name, java.lang.Object value)Default constructor- Parameters:
name- the header namevalue- the header value, taken as the value'stoString().
-
BasicHeader
public BasicHeader(java.lang.String name, java.lang.Object value, boolean sensitive)Constructor with sensitivity flag- Parameters:
name- the header namevalue- the header value, taken as the value'stoString().sensitive- sensitive flag- Since:
- 5.0
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:NameValuePairGets the name of this pair.- Specified by:
getNamein interfaceNameValuePair- Returns:
- the name of this pair, never
null.
-
getValue
public java.lang.String getValue()
Description copied from interface:NameValuePairGets the value of this pair.- Specified by:
getValuein interfaceNameValuePair- Returns:
- the value of this pair, may be
null.
-
isSensitive
public boolean isSensitive()
Description copied from interface:HeaderReturnstrueif the header should be considered sensitive.Some encoding schemes such as HPACK impose restrictions on encoded representation of sensitive headers.
- Specified by:
isSensitivein interfaceHeader- Returns:
trueif the header should be considered sensitive.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public BasicHeader clone() throws java.lang.CloneNotSupportedException
- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-