public class DefaultHttpParams extends Object implements HttpParams, Serializable, 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.
|
Object |
clone()
Clones this collection of parameters.
|
boolean |
getBooleanParameter(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(String name,
double defaultValue)
Returns a
Double parameter value with the given name. |
int |
getIntParameter(String name,
int defaultValue)
Returns an
Integer parameter value with the given name. |
long |
getLongParameter(String name,
long defaultValue)
Returns a
Long parameter value with the given name. |
Object |
getParameter(String name)
Returns a parameter value with the given name.
|
boolean |
isParameterFalse(String name)
Returns true if the parameter is either not set or is false,
false otherwise.
|
boolean |
isParameterSet(String name)
Returns true if the parameter is set at any level, false otherwise.
|
boolean |
isParameterSetLocally(String name)
Returns true if the parameter is set locally, false otherwise.
|
boolean |
isParameterTrue(String name)
Returns true if the parameter is set and is true, false
otherwise.
|
void |
setBooleanParameter(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(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(String name,
int value)
Assigns an
Integer to the parameter with the given name |
void |
setLongParameter(String name,
long value)
Assigns a
Long to the parameter with the given name |
void |
setParameter(String name,
Object value)
Assigns the value to the parameter with the given name
|
void |
setParameters(String[] names,
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 Object getParameter(String name)
HttpParamsgetParameter in interface HttpParamsname - the parent name.HttpParams.setParameter(String, Object)public void setParameter(String name, Object value)
HttpParamssetParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic void setParameters(String[] names, Object value)
names - array of parameter namevalue - parameter valuepublic long getLongParameter(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(String name, long value)
HttpParamsLong to the parameter with the given namesetLongParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic int getIntParameter(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(String name, int value)
HttpParamsInteger to the parameter with the given namesetIntParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic double getDoubleParameter(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(String name, double value)
HttpParamsDouble to the parameter with the given namesetDoubleParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic boolean getBooleanParameter(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(String name, boolean value)
HttpParamsBoolean to the parameter with the given namesetBooleanParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic boolean isParameterSet(String name)
HttpParamsisParameterSet in interface HttpParamsname - parameter namepublic boolean isParameterSetLocally(String name)
HttpParamsisParameterSetLocally in interface HttpParamsname - parameter namepublic boolean isParameterTrue(String name)
HttpParamsisParameterTrue in interface HttpParamsname - parameter namepublic boolean isParameterFalse(String name)
HttpParamsisParameterFalse in interface HttpParamsname - parameter namepublic void clear()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionSerializable,
Object.clone()Copyright © 2021 Internet2. All rights reserved.