FileDocCategorySizeDatePackage
DefaultedHttpParams.javaAPI DocAndroid 1.5 API3626Wed May 06 22:41:10 BST 2009org.apache.http.params

DefaultedHttpParams

public final class DefaultedHttpParams extends AbstractHttpParams
{@link HttpParams} implementation that delegates resolution of a parameter to the given default {@link HttpParams} instance if the parameter is not present in the local one. The state of the local collection can be mutated, whereas the default collection is treated as read-only.
author
Oleg Kalnichevski
version
$Revision: 610763 $

Fields Summary
private final HttpParams
local
private final HttpParams
defaults
Constructors Summary
public DefaultedHttpParams(HttpParams local, HttpParams defaults)

        super();
        if (local == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
        }
        this.local = local;
        this.defaults = defaults;
    
Methods Summary
public org.apache.http.params.HttpParamscopy()
Creates a copy of the local collection with the same default

        HttpParams clone = this.local.copy();
        return new DefaultedHttpParams(clone, this.defaults);
    
public org.apache.http.params.HttpParamsgetDefaults()

        return this.defaults;
    
public java.lang.ObjectgetParameter(java.lang.String name)
Retrieves the value of the parameter from the local collection and, if the parameter is not set locally, delegates its resolution to the default collection.

        Object obj = this.local.getParameter(name);
        if (obj == null && this.defaults != null) {
            obj = this.defaults.getParameter(name);
        }
        return obj;
    
public booleanremoveParameter(java.lang.String name)
Attempts to remove the parameter from the local collection. This method does not modify the default collection.

        return this.local.removeParameter(name);
    
public org.apache.http.params.HttpParamssetParameter(java.lang.String name, java.lang.Object value)
Sets the parameter in the local collection. This method does not modify the default collection.

        return this.local.setParameter(name, value);