/** * Creates a new collection of parameters with the collection returned * by {@link #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. * * @see #getDefaultParams() */ public DefaultHttpParams() { this(getDefaultParams()); }
/** * Assigns the value to all the parameter with the given names * * @param names array of parameter name * @param value parameter value */ public synchronized void setParameters(final String[] names, final Object value) { for (int i = 0; i < names.length; i++) { setParameter(names[i], value); } }
public boolean isParameterTrue(final String name) { return getBooleanParameter(name, false); }
public boolean isParameterSet(final String name) { return getParameter(name) != null; }
/** * Clones this collection of parameters. Please note that paramter values * themselves are not cloned. * * @see java.io.Serializable * @see java.lang.Object#clone() */ public Object clone() throws CloneNotSupportedException { DefaultHttpParams clone = (DefaultHttpParams)super.clone(); if (this.parameters != null) { clone.parameters = (HashMap)this.parameters.clone(); } clone.setDefaults(this.defaults); return clone; } }
public boolean getBooleanParameter(final String name, boolean defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; } return ((Boolean)param).booleanValue(); }
/** * Clones this collection of parameters. Please note that paramter values * themselves are not cloned. * * @see java.io.Serializable * @see java.lang.Object#clone() */ public Object clone() throws CloneNotSupportedException { DefaultHttpParams clone = (DefaultHttpParams)super.clone(); if (this.parameters != null) { clone.parameters = (HashMap)this.parameters.clone(); } clone.setDefaults(this.defaults); return clone; } }
public void setBooleanParameter(final String name, boolean value) { setParameter(name, value ? Boolean.TRUE : Boolean.FALSE);// Boolean.valueOf() = Java 1.4+ }
public double getDoubleParameter(final String name, double defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; } return ((Double)param).doubleValue(); }
/** * Creates a new collection of parameters with the collection returned * by {@link #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. * * @see #getDefaultParams() */ public DefaultHttpParams() { this(getDefaultParams()); }
public boolean isParameterFalse(final String name) { return !getBooleanParameter(name, false); }
/** * Clones this collection of parameters. Please note that paramter values * themselves are not cloned. * * @see java.io.Serializable * @see java.lang.Object#clone() */ public Object clone() throws CloneNotSupportedException { DefaultHttpParams clone = (DefaultHttpParams)super.clone(); if (this.parameters != null) { clone.parameters = (HashMap)this.parameters.clone(); } clone.setDefaults(this.defaults); return clone; } }
public void setLongParameter(final String name, long value) { setParameter(name, new Long(value)); }
public int getIntParameter(final String name, int defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; } return ((Integer)param).intValue(); }
/** * Creates a new collection of parameters with the collection returned * by {@link #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. * * @see #getDefaultParams() */ public DefaultHttpParams() { this(getDefaultParams()); }
public boolean isParameterTrue(final String name) { return getBooleanParameter(name, false); }
/** * Clones this collection of parameters. Please note that paramter values * themselves are not cloned. * * @see java.io.Serializable * @see java.lang.Object#clone() */ public Object clone() throws CloneNotSupportedException { DefaultHttpParams clone = (DefaultHttpParams)super.clone(); if (this.parameters != null) { clone.parameters = (HashMap)this.parameters.clone(); } clone.setDefaults(this.defaults); return clone; } }
public void setIntParameter(final String name, int value) { setParameter(name, new Integer(value)); }
public long getLongParameter(final String name, long defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; } return ((Long)param).longValue(); }
/** * Creates a new collection of parameters with the collection returned * by {@link #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. * * @see #getDefaultParams() */ public DefaultHttpParams() { this(getDefaultParams()); }