FileDocCategorySizeDatePackage
BasicHttpContext.javaAPI DocAndroid 1.5 API3030Wed May 06 22:41:10 BST 2009org.apache.http.protocol

BasicHttpContext

public class BasicHttpContext extends Object implements HttpContext
Default implementation of the {@link HttpContext HttpContext}.
author
Oleg Kalnichevski
version
$Revision: 654882 $
since
4.0

Fields Summary
private final HttpContext
parentContext
private Map
map
Constructors Summary
public BasicHttpContext()

    
      
        this(null);
    
public BasicHttpContext(HttpContext parentContext)

        super();
        this.parentContext = parentContext;
    
Methods Summary
public java.lang.ObjectgetAttribute(java.lang.String id)

        if (id == null) {
            throw new IllegalArgumentException("Id may not be null");
        }
        Object obj = null;
        if (this.map != null) {
            obj = this.map.get(id);
        }
        if (obj == null && this.parentContext != null) {
            obj = this.parentContext.getAttribute(id);
        }
        return obj;
    
public java.lang.ObjectremoveAttribute(java.lang.String id)

        if (id == null) {
            throw new IllegalArgumentException("Id may not be null");
        }
        if (this.map != null) {
            return this.map.remove(id);
        } else {
            return null;
        }
    
public voidsetAttribute(java.lang.String id, java.lang.Object obj)

        if (id == null) {
            throw new IllegalArgumentException("Id may not be null");
        }
        if (this.map == null) {
            this.map = new HashMap();
        }
        this.map.put(id, obj);