Package org.apache.http.params
Interface HttpParams
- All Known Implementing Classes:
AbstractHttpParams,BasicHttpParams,ClientParamsStack,DefaultedHttpParams,SyncBasicHttpParams
Deprecated.
(4.3) use configuration classes provided 'org.apache.http.config'
and 'org.apache.http.client.config'
HttpParams interface represents a collection of immutable values that define
a runtime behavior of a component. HTTP parameters should be simple objects:
integers, doubles, strings, collections and objects that remain immutable
at runtime. HttpParams is expected to be used in 'write once - read many' mode.
Once initialized, HTTP parameters are not expected to mutate in
the course of HTTP message processing.
The purpose of this interface is to define a behavior of other components. Usually each complex component has its own HTTP parameter collection.
Instances of this interface can be linked together to form a hierarchy. In the simplest form one set of parameters can use content of another one to obtain default values of parameters not present in the local set.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Deprecated.Creates a copy of these parameters.booleangetBooleanParameter(String name, boolean defaultValue) Deprecated.Returns aBooleanparameter value with the given name.doublegetDoubleParameter(String name, double defaultValue) Deprecated.Returns aDoubleparameter value with the given name.intgetIntParameter(String name, int defaultValue) Deprecated.Returns anIntegerparameter value with the given name.longgetLongParameter(String name, long defaultValue) Deprecated.Returns aLongparameter value with the given name.getParameter(String name) Deprecated.Obtains the value of the given parameter.booleanisParameterFalse(String name) Deprecated.Checks if a boolean parameter is not set orfalse.booleanisParameterTrue(String name) Deprecated.Checks if a boolean parameter is set totrue.booleanremoveParameter(String name) Deprecated.Removes the parameter with the specified name.setBooleanParameter(String name, boolean value) Deprecated.Assigns aBooleanto the parameter with the given namesetDoubleParameter(String name, double value) Deprecated.Assigns aDoubleto the parameter with the given namesetIntParameter(String name, int value) Deprecated.Assigns anIntegerto the parameter with the given namesetLongParameter(String name, long value) Deprecated.Assigns aLongto the parameter with the given namesetParameter(String name, Object value) Deprecated.Assigns the value to the parameter with the given name.
-
Method Details
-
getParameter
Deprecated.Obtains the value of the given parameter.- 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:
-
setParameter
Deprecated.Assigns the value to the parameter with the given name.- Parameters:
name- parameter namevalue- parameter value
-
copy
HttpParams copy()Deprecated.Creates a copy of these parameters.- Returns:
- a new set of parameters holding the same values as this one
-
removeParameter
Deprecated.Removes the parameter with the specified name.- Parameters:
name- parameter name- Returns:
- true if the parameter existed and has been removed, false else.
-
getLongParameter
Deprecated.Returns aLongparameter value with the given name. If the parameter is not explicitly set, the default value is returned.- Parameters:
name- the parent name.defaultValue- the default value.- Returns:
- a
Longthat represents the value of the parameter. - See Also:
-
setLongParameter
Deprecated.Assigns aLongto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getIntParameter
Deprecated.Returns anIntegerparameter value with the given name. If the parameter is not explicitly set, the default value is returned.- Parameters:
name- the parent name.defaultValue- the default value.- Returns:
- a
Integerthat represents the value of the parameter. - See Also:
-
setIntParameter
Deprecated.Assigns anIntegerto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getDoubleParameter
Deprecated.Returns aDoubleparameter value with the given name. If the parameter is not explicitly set, the default value is returned.- Parameters:
name- the parent name.defaultValue- the default value.- Returns:
- a
Doublethat represents the value of the parameter. - See Also:
-
setDoubleParameter
Deprecated.Assigns aDoubleto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getBooleanParameter
Deprecated.Returns aBooleanparameter value with the given name. If the parameter is not explicitly set, the default value is returned.- Parameters:
name- the parent name.defaultValue- the default value.- Returns:
- a
Booleanthat represents the value of the parameter. - See Also:
-
setBooleanParameter
Deprecated.Assigns aBooleanto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
isParameterTrue
Deprecated.Checks if a boolean parameter is set totrue.- Parameters:
name- parameter name- Returns:
trueif the parameter is set to valuetrue,falseif it is not set or set tofalse
-
isParameterFalse
Deprecated.Checks if a boolean parameter is not set orfalse.- Parameters:
name- parameter name- Returns:
trueif the parameter is either not set or set to valuefalse,falseif it is set totrue
-