Top Description Fields Constructors Methods
org.apache.hc.core5.http.protocol

public Class BasicHttpContext

extends Object
implements HttpContext
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.protocol.HttpContext
Annotations
@Contract
threading:SAFE_CONDITIONAL
Imports
java.util.Map, java.util.concurrent.ConcurrentHashMap, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HttpVersion, .ProtocolVersion, org.apache.hc.core5.util.Args

Default implementation of HttpContext.

Please note instances of this class can be thread unsafe if the parent context is not thread safe.

Since
4.0

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>
private final HttpContext
private ProtocolVersion

Constructor Summary

AccessConstructor and Description
public
public
BasicHttpContext(final HttpContext parentContext)

Method Summary

Modifier and TypeMethod and Description
public void
public Object
getAttribute(final String
the attribute name.
id
)

Implements org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.
public ProtocolVersion
getProtocolVersion()

Implements org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Returns protocol version used in this context.
public Object
removeAttribute(final String
the attribute name.
id
)

Implements org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.
public Object
setAttribute(final String
the attribute name.
id
,
final Object
the attribute value.
obj
)

Implements org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.
public void
setProtocolVersion(final ProtocolVersion version)

Implements org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Sets protocol version used in this context.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

mapback to summary
private final Map<String, Object> map
parentContextback to summary
private final HttpContext parentContext
versionback to summary
private ProtocolVersion version

Constructor Detail

BasicHttpContextback to summary
public BasicHttpContext()
BasicHttpContextback to summary
public BasicHttpContext(final HttpContext parentContext)

Method Detail

clearback to summary
public void clear()
Since
4.2
getAttributeback to summary
public Object getAttribute(final String id)

Implements org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
getProtocolVersionback to summary
public ProtocolVersion getProtocolVersion()

Implements org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Doc from org.apache.hc.core5.http.protocol.HttpContext.getProtocolVersion.

Returns protocol version used in this context.

Annotations
@Override
Since
5.0
removeAttributeback to summary
public Object removeAttribute(final String id)

Implements org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
setAttributeback to summary
public Object setAttribute(final String id, final Object obj)

Implements org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Doc from org.apache.hc.core5.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.

Parameters
id:String

the attribute name.

obj:Object

the attribute value.

Returns:Object

the previous value associated with id, or null if there was no mapping for id.

Annotations
@Override
setProtocolVersionback to summary
public void setProtocolVersion(final ProtocolVersion version)

Implements org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Doc from org.apache.hc.core5.http.protocol.HttpContext.setProtocolVersion.

Sets protocol version used in this context.

Annotations
@Override
Since
5.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override