org.apache.commons.httpclient.params
public class DefaultHttpParams extends java.lang.Object implements HttpParams, java.io.Serializable, java.lang.Cloneable
| Constructor and Description |
|---|
DefaultHttpParams()
Creates a new collection of parameters with the collection returned
by
getDefaultParams() as a parent. |
DefaultHttpParams(HttpParams defaults)
Creates a new collection of parameters with the given parent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all parameters from this collection.
|
java.lang.Object |
clone()
Clones this collection of parameters.
|
boolean |
getBooleanParameter(java.lang.String name,
boolean defaultValue)
Returns a
Boolean parameter value with the given name. |
static HttpParams |
getDefaultParams()
Gets the default HttpParams to be used.
|
HttpParams |
getDefaults()
Returns the parent collection that this collection will defer to
for a default value if a particular parameter is not explicitly
set in the collection itself
|
double |
getDoubleParameter(java.lang.String name,
double defaultValue)
Returns a
Double parameter value with the given name. |
int |
getIntParameter(java.lang.String name,
int defaultValue)
Returns an
Integer parameter value with the given name. |
long |
getLongParameter(java.lang.String name,
long defaultValue)
Returns a
Long parameter value with the given name. |
java.lang.Object |
getParameter(java.lang.String name)
Returns a parameter value with the given name.
|
boolean |
isParameterFalse(java.lang.String name)
Returns true if the parameter is either not set or is false,
false otherwise.
|
boolean |
isParameterSet(java.lang.String name)
Returns true if the parameter is set at any level, false otherwise.
|
boolean |
isParameterSetLocally(java.lang.String name)
Returns true if the parameter is set locally, false otherwise.
|
boolean |
isParameterTrue(java.lang.String name)
Returns true if the parameter is set and is true, false
otherwise.
|
void |
setBooleanParameter(java.lang.String name,
boolean value)
Assigns a
Boolean to the parameter with the given name |
void |
setDefaults(HttpParams params)
Assigns the parent collection that this collection will defer to
for a default value if a particular parameter is not explicitly
set in the collection itself
|
void |
setDoubleParameter(java.lang.String name,
double value)
Assigns a
Double to the parameter with the given name |
static void |
setHttpParamsFactory(HttpParamsFactory httpParamsFactory)
Sets the factory that will provide the default HttpParams.
|
void |
setIntParameter(java.lang.String name,
int value)
Assigns an
Integer to the parameter with the given name |
void |
setLongParameter(java.lang.String name,
long value)
Assigns a
Long to the parameter with the given name |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Assigns the value to the parameter with the given name
|
void |
setParameters(java.lang.String[] names,
java.lang.Object value)
Assigns the value to all the parameter with the given names
|
public DefaultHttpParams(HttpParams defaults)
defaults - the parent collection to defer to, if a parameter
is not explictly set in the collection itself.public DefaultHttpParams()
getDefaultParams() as a parent. The collection will defer
to its parent for a default value if a particular parameter is not
explicitly set in the collection itself.getDefaultParams()public static HttpParams getDefaultParams()
HttpParamsFactory#getDefaultParams()HttpParamsFactory.getDefaultParams()public static void setHttpParamsFactory(HttpParamsFactory httpParamsFactory)
httpParamsFactory - an instance of HttpParamsFactorygetDefaultParams()public HttpParams getDefaults()
HttpParamsgetDefaults in interface HttpParamsHttpParams.setDefaults(HttpParams)public void setDefaults(HttpParams params)
HttpParamssetDefaults in interface HttpParamsparams - the parent collection to defer to, if a particular
parameter is not explictly set in the collection itself.HttpParams.getDefaults()public java.lang.Object getParameter(java.lang.String name)
HttpParamsgetParameter in interface HttpParamsname - the parent name.HttpParams.setParameter(String, Object)public void setParameter(java.lang.String name,
java.lang.Object value)
HttpParamssetParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic void setParameters(java.lang.String[] names,
java.lang.Object value)
names - array of parameter namevalue - parameter valuepublic long getLongParameter(java.lang.String name,
long defaultValue)
HttpParamsLong parameter value with the given name.
If the parameter is not explicitly defined in this collection, its
value will be drawn from a higer level collection at which this parameter
is defined. If the parameter is not explicitly set anywhere up the hierarchy,
the default value is returned.getLongParameter in interface HttpParamsname - the parent name.defaultValue - the default value.Long that represents the value of the parameter.HttpParams.setLongParameter(String, long)public void setLongParameter(java.lang.String name,
long value)
HttpParamsLong to the parameter with the given namesetLongParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic int getIntParameter(java.lang.String name,
int defaultValue)
HttpParamsInteger parameter value with the given name.
If the parameter is not explicitly defined in this collection, its
value will be drawn from a higer level collection at which this parameter
is defined. If the parameter is not explicitly set anywhere up the hierarchy,
the default value is returned.getIntParameter in interface HttpParamsname - the parent name.defaultValue - the default value.Integer that represents the value of the parameter.HttpParams.setIntParameter(String, int)public void setIntParameter(java.lang.String name,
int value)
HttpParamsInteger to the parameter with the given namesetIntParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic double getDoubleParameter(java.lang.String name,
double defaultValue)
HttpParamsDouble parameter value with the given name.
If the parameter is not explicitly defined in this collection, its
value will be drawn from a higer level collection at which this parameter
is defined. If the parameter is not explicitly set anywhere up the hierarchy,
the default value is returned.getDoubleParameter in interface HttpParamsname - the parent name.defaultValue - the default value.Double that represents the value of the parameter.HttpParams.setDoubleParameter(String, double)public void setDoubleParameter(java.lang.String name,
double value)
HttpParamsDouble to the parameter with the given namesetDoubleParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic boolean getBooleanParameter(java.lang.String name,
boolean defaultValue)
HttpParamsBoolean parameter value with the given name.
If the parameter is not explicitly defined in this collection, its
value will be drawn from a higer level collection at which this parameter
is defined. If the parameter is not explicitly set anywhere up the hierarchy,
the default value is returned.getBooleanParameter in interface HttpParamsname - the parent name.defaultValue - the default value.Boolean that represents the value of the parameter.HttpParams.setBooleanParameter(String, boolean)public void setBooleanParameter(java.lang.String name,
boolean value)
HttpParamsBoolean to the parameter with the given namesetBooleanParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic boolean isParameterSet(java.lang.String name)
HttpParamsisParameterSet in interface HttpParamsname - parameter namepublic boolean isParameterSetLocally(java.lang.String name)
HttpParamsisParameterSetLocally in interface HttpParamsname - parameter namepublic boolean isParameterTrue(java.lang.String name)
HttpParamsisParameterTrue in interface HttpParamsname - parameter namepublic boolean isParameterFalse(java.lang.String name)
HttpParamsisParameterFalse in interface HttpParamsname - parameter namepublic void clear()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionSerializable,
Object.clone()