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

public Class BasicHttpContext

extends Object
implements HttpContext
Class Inheritance
All Implemented Interfaces
org.apache.http.protocol.HttpContext
Known Direct Subclasses
org.apache.http.protocol.SyncBasicHttpContext
Annotations
@Contract
threading:SAFE_CONDITIONAL
Imports
java.util.Map, java.util.concurrent.ConcurrentHashMap, org.apache.http.annotation.ThreadingBehavior, .Contract, org.apache.http.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

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.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.
public Object
removeAttribute(final String
the attribute name.
id
)

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

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

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

Sets value of the attribute with the given name.
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

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.http.protocol.HttpContext.getAttribute.

Doc from org.apache.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
removeAttributeback to summary
public Object removeAttribute(final String id)

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

Doc from org.apache.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 void setAttribute(final String id, final Object obj)

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

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

Sets value of the attribute with the given name.

Parameters
id:String

the attribute name.

obj:Object

the attribute value.

Annotations
@Override
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