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.String
name
private boolean
sensitive
private static long
serialVersionUID
private java.lang.String
value
-
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 BasicHeader
clone()
java.lang.String
getName()
Gets the name of this pair.java.lang.String
getValue()
Gets the value of this pair.boolean
isSensitive()
Returnstrue
if the header should be considered sensitive.java.lang.String
toString()
-
-
-
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:NameValuePair
Gets the name of this pair.- Specified by:
getName
in interfaceNameValuePair
- Returns:
- the name of this pair, never
null
.
-
getValue
public java.lang.String getValue()
Description copied from interface:NameValuePair
Gets the value of this pair.- Specified by:
getValue
in interfaceNameValuePair
- Returns:
- the value of this pair, may be
null
.
-
isSensitive
public boolean isSensitive()
Description copied from interface:Header
Returnstrue
if the header should be considered sensitive.Some encoding schemes such as HPACK impose restrictions on encoded representation of sensitive headers.
- Specified by:
isSensitive
in interfaceHeader
- Returns:
true
if the header should be considered sensitive.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public BasicHeader clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-