public final class

DefaultedHttpContext

extends Object
implements HttpContext
java.lang.Object
   ↳ org.apache.http.protocol.DefaultedHttpContext

Class Overview

HttpContext implementation that delegates resolution of an attribute to the given default HttpContext instance if the attribute is not present in the local one. The state of the local context can be mutated, whereas the default context is treated as read-only.

Summary

[Expand]
Inherited Constants
From interface org.apache.http.protocol.HttpContext
Public Constructors
DefaultedHttpContext(HttpContext local, HttpContext defaults)
Public Methods
Object getAttribute(String id)
Obtains attribute with the given name.
HttpContext getDefaults()
Object removeAttribute(String id)
Removes attribute with the given name from the context.
void setAttribute(String id, Object obj)
Sets value of the attribute with the given name.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.protocol.HttpContext

Public Constructors

public DefaultedHttpContext (HttpContext local, HttpContext defaults)

Public Methods

public Object getAttribute (String id)

Obtains attribute with the given name.

Parameters
id the attribute name.
Returns
  • attribute value, or null if not set.

public HttpContext getDefaults ()

public Object removeAttribute (String id)

Removes attribute with the given name from the context.

Parameters
id the attribute name.
Returns
  • attribute value, or null if not set.

public void setAttribute (String id, Object obj)

Sets value of the attribute with the given name.

Parameters
id the attribute name.
obj the attribute value.