Package org.apache.http.params
Interface HttpParams
- All Known Implementing Classes:
AbstractHttpParams,BasicHttpParams,ClientParamsStack,DefaultedHttpParams
public interface HttpParams
Represents a collection of HTTP protocol and framework parameters.
- Since:
- 4.0
- Version:
- $Revision: 610763 $
- Author:
- Oleg Kalnichevski
-
Method Summary
Modifier and Type Method Description HttpParamscopy()Creates a copy of these parameters.booleangetBooleanParameter(String name, boolean defaultValue)Returns aBooleanparameter value with the given name.doublegetDoubleParameter(String name, double defaultValue)Returns aDoubleparameter value with the given name.intgetIntParameter(String name, int defaultValue)Returns anIntegerparameter value with the given name.longgetLongParameter(String name, long defaultValue)Returns aLongparameter value with the given name.ObjectgetParameter(String name)Obtains the value of the given parameter.booleanisParameterFalse(String name)Checks if a boolean parameter is not set orfalse.booleanisParameterTrue(String name)Checks if a boolean parameter is set totrue.booleanremoveParameter(String name)Removes the parameter with the specified name.HttpParamssetBooleanParameter(String name, boolean value)Assigns aBooleanto the parameter with the given nameHttpParamssetDoubleParameter(String name, double value)Assigns aDoubleto the parameter with the given nameHttpParamssetIntParameter(String name, int value)Assigns anIntegerto the parameter with the given nameHttpParamssetLongParameter(String name, long value)Assigns aLongto the parameter with the given nameHttpParamssetParameter(String name, Object value)Assigns the value to the parameter with the given name.
-
Method Details
-
getParameter
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(String, Object)
-
setParameter
Assigns the value to the parameter with the given name.- Parameters:
name- parameter namevalue- parameter value
-
copy
HttpParams copy()Creates a copy of these parameters.- Returns:
- a new set of parameters holding the same values as this one
-
removeParameter
Removes the parameter with the specified name.- Parameters:
name- parameter name- Returns:
- true if the parameter existed and has been removed, false else.
-
getLongParameter
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(String, long)
-
setLongParameter
Assigns aLongto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getIntParameter
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(String, int)
-
setIntParameter
Assigns anIntegerto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getDoubleParameter
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(String, double)
-
setDoubleParameter
Assigns aDoubleto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
getBooleanParameter
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(String, boolean)
-
setBooleanParameter
Assigns aBooleanto the parameter with the given name- Parameters:
name- parameter namevalue- parameter value
-
isParameterTrue
Checks if a boolean parameter is set totrue.- Parameters:
name- parameter name- Returns:
- true if the parameter is set to value true,
false if it is not set or set to
false
-
isParameterFalse
Checks if a boolean parameter is not set orfalse.- Parameters:
name- parameter name- Returns:
- true if the parameter is either not set or
set to value false,
false if it is set to
true
-