Package org.apache.http.params
Class DefaultedHttpParams
java.lang.Object
org.apache.http.params.AbstractHttpParams
org.apache.http.params.DefaultedHttpParams
- All Implemented Interfaces:
HttpParams
public final class DefaultedHttpParams extends AbstractHttpParams
HttpParams implementation that delegates resolution of a parameter
to the given default 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.- Version:
- $Revision: 610763 $
- Author:
- Oleg Kalnichevski
-
Constructor Summary
Constructors Constructor Description DefaultedHttpParams(HttpParams local, HttpParams defaults) -
Method Summary
Modifier and Type Method Description HttpParamscopy()Creates a copy of the local collection with the same defaultHttpParamsgetDefaults()ObjectgetParameter(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.booleanremoveParameter(String name)Attempts to remove the parameter from the local collection.HttpParamssetParameter(String name, Object value)Sets the parameter in the local collection.Methods inherited from class org.apache.http.params.AbstractHttpParams
getBooleanParameter, getDoubleParameter, getIntParameter, getLongParameter, isParameterFalse, isParameterTrue, setBooleanParameter, setDoubleParameter, setIntParameter, setLongParameter
-
Constructor Details
-
DefaultedHttpParams
-
-
Method Details
-
copy
Creates a copy of the local collection with the same default- Returns:
- a new set of parameters holding the same values as this one
-
getParameter
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.- Parameters:
name- the parent name.- Returns:
- an object that represents the value of the parameter,
nullif the parameter is not set or if it is explicitly set tonull - See Also:
HttpParams.setParameter(String, Object)
-
removeParameter
Attempts to remove the parameter from the local collection. This method does not modify the default collection.- Parameters:
name- parameter name- Returns:
- true if the parameter existed and has been removed, false else.
-
setParameter
Sets the parameter in the local collection. This method does not modify the default collection.- Parameters:
name- parameter namevalue- parameter value
-
getDefaults
-