Package org.apache.http.params
Class BasicHttpParams
java.lang.Object
org.apache.http.params.AbstractHttpParams
org.apache.http.params.BasicHttpParams
- All Implemented Interfaces:
Serializable,Cloneable,HttpParams
public final class BasicHttpParams extends AbstractHttpParams implements Serializable, Cloneable
This class represents a collection of HTTP protocol parameters.
Protocol parameters may be linked together to form a hierarchy.
If a particular parameter value has not been explicitly defined
in the collection itself, its value will be drawn from the parent
collection of parameters.
- Version:
- $Revision: 610464 $
- Author:
- Oleg Kalnichevski
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description BasicHttpParams() -
Method Summary
Modifier and Type Method Description voidclear()Removes all parameters from this collection.Objectclone()Creates and returns a copy of thisObject.HttpParamscopy()Creates a copy of these parameters.protected voidcopyParams(HttpParams target)Copies the locally defined parameters to the argument parameters.ObjectgetParameter(String name)Obtains the value of the given parameter.booleanisParameterSet(String name)booleanisParameterSetLocally(String name)booleanremoveParameter(String name)Removes the parameter with the specified name.HttpParamssetParameter(String name, Object value)Assigns the value to the parameter with the given name.voidsetParameters(String[] names, Object value)Assigns the value to all the parameter with the given namesMethods inherited from class org.apache.http.params.AbstractHttpParams
getBooleanParameter, getDoubleParameter, getIntParameter, getLongParameter, isParameterFalse, isParameterTrue, setBooleanParameter, setDoubleParameter, setIntParameter, setLongParameter
-
Constructor Details
-
BasicHttpParams
public BasicHttpParams()
-
-
Method Details
-
getParameter
Description copied from interface:HttpParamsObtains the value of the given parameter.- Specified by:
getParameterin interfaceHttpParams- 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)
-
setParameter
Description copied from interface:HttpParamsAssigns the value to the parameter with the given name.- Specified by:
setParameterin interfaceHttpParams- Parameters:
name- parameter namevalue- parameter value
-
removeParameter
Description copied from interface:HttpParamsRemoves the parameter with the specified name.- Specified by:
removeParameterin interfaceHttpParams- Parameters:
name- parameter name- Returns:
- true if the parameter existed and has been removed, false else.
-
setParameters
Assigns the value to all the parameter with the given names- Parameters:
names- array of parameter namevalue- parameter value
-
isParameterSet
-
isParameterSetLocally
-
clear
public void clear()Removes all parameters from this collection. -
copy
Creates a copy of these parameters. The implementation here instantiatesBasicHttpParams, then callscopyParams(HttpParams)to populate the copy.- Specified by:
copyin interfaceHttpParams- Returns:
- a new set of params holding a copy of the local parameters in this object.
-
clone
Description copied from class:ObjectCreates and returns a copy of thisObject. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should callsuper.clone()to create the new instance and then create deep copies of the nested, mutable objects.- Overrides:
clonein classObject- Returns:
- a copy of this object.
- Throws:
CloneNotSupportedException- if this object's class does not implement theCloneableinterface.
-
copyParams
Copies the locally defined parameters to the argument parameters. This method is called fromcopy().- Parameters:
target- the parameters to which to copy
-