## org.apache.http.params
Class AbstractHttpParams

    java.lang.Object
      org.apache.http.params.AbstractHttpParams

All Implemented Interfaces:
  HttpParams, HttpParamsNames

Direct Known Subclasses:
  BasicHttpParams, DefaultedHttpParams

    public abstract class AbstractHttpParams

extends Object
implements HttpParams, HttpParamsNames

Abstract base class for parameter collections. Type specific setters and getters are mapped to the abstract, generic getters and setters.

Since:
  4.0

Constructor Summary
`protected` `AbstractHttpParams()` Instantiates parameters.

Method Summary
`boolean` `getBooleanParameter(String name, boolean defaultValue)` Returns a `Boolean` parameter value with the given name.
`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.
`Set<String>` `getNames()` Returns the current set of names; in the case of stacked parameters, returns the names from all the participating HttpParams instances. Dummy implementation - must be overridden by subclasses.
`boolean` `isParameterFalse(String name)` Checks if a boolean parameter is not set or `false`.
`boolean` `isParameterTrue(String name)` Checks if a boolean parameter is set to `true`.
`HttpParams` `setBooleanParameter(String name, boolean value)` Assigns a `Boolean` to the parameter with the given name
`HttpParams` `setDoubleParameter(String name, double value)` Assigns a `Double` to the parameter with the given name
`HttpParams` `setIntParameter(String name, int value)` Assigns an `Integer` to the parameter with the given name
`HttpParams` `setLongParameter(String name, long value)` Assigns a `Long` to the parameter with the given name

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.http.params.HttpParams
`copy, getParameter, removeParameter, setParameter`

Constructor Detail

### AbstractHttpParams

    protected AbstractHttpParams()

  Instantiates parameters.

Method Detail

### getLongParameter

    public long getLongParameter(String name,
                                 long defaultValue)

  Description copied from interface: `HttpParams`
  Returns a `Long` parameter value with the given name. If the parameter is not explicitly set, the default value is returned.

  Specified by:
    `getLongParameter` in interface `HttpParams`
  Parameters:
    `name` - the parent name.
    `defaultValue` - the default value.
  Returns:
    a `Long` that represents the value of the parameter.
  See Also:
    `HttpParams.setLongParameter(String, long)`

### setLongParameter

    public HttpParams setLongParameter(String name,
                                       long value)

  Description copied from interface: `HttpParams`
  Assigns a `Long` to the parameter with the given name

  Specified by:
    `setLongParameter` in interface `HttpParams`
  Parameters:
    `name` - parameter name
    `value` - parameter value

### getIntParameter

    public int getIntParameter(String name,
                               int defaultValue)

  Description copied from interface: `HttpParams`
  Returns an `Integer` parameter value with the given name. If the parameter is not explicitly set, the default value is returned.

  Specified by:
    `getIntParameter` in interface `HttpParams`
  Parameters:
    `name` - the parent name.
    `defaultValue` - the default value.
  Returns:
    a `Integer` that represents the value of the parameter.
  See Also:
    `HttpParams.setIntParameter(String, int)`

### setIntParameter

    public HttpParams setIntParameter(String name,
                                      int value)

  Description copied from interface: `HttpParams`
  Assigns an `Integer` to the parameter with the given name

  Specified by:
    `setIntParameter` in interface `HttpParams`
  Parameters:
    `name` - parameter name
    `value` - parameter value

### getDoubleParameter

    public double getDoubleParameter(String name,
                                     double defaultValue)

  Description copied from interface: `HttpParams`
  Returns a `Double` parameter value with the given name. If the parameter is not explicitly set, the default value is returned.

  Specified by:
    `getDoubleParameter` in interface `HttpParams`
  Parameters:
    `name` - the parent name.
    `defaultValue` - the default value.
  Returns:
    a `Double` that represents the value of the parameter.
  See Also:
    `HttpParams.setDoubleParameter(String, double)`

### setDoubleParameter

    public HttpParams setDoubleParameter(String name,
                                         double value)

  Description copied from interface: `HttpParams`
  Assigns a `Double` to the parameter with the given name

  Specified by:
    `setDoubleParameter` in interface `HttpParams`
  Parameters:
    `name` - parameter name
    `value` - parameter value

### getBooleanParameter

    public boolean getBooleanParameter(String name,
                                       boolean defaultValue)

  Description copied from interface: `HttpParams`
  Returns a `Boolean` parameter value with the given name. If the parameter is not explicitly set, the default value is returned.

  Specified by:
    `getBooleanParameter` in interface `HttpParams`
  Parameters:
    `name` - the parent name.
    `defaultValue` - the default value.
  Returns:
    a `Boolean` that represents the value of the parameter.
  See Also:
    `HttpParams.setBooleanParameter(String, boolean)`

### setBooleanParameter

    public HttpParams setBooleanParameter(String name,
                                          boolean value)

  Description copied from interface: `HttpParams`
  Assigns a `Boolean` to the parameter with the given name

  Specified by:
    `setBooleanParameter` in interface `HttpParams`
  Parameters:
    `name` - parameter name
    `value` - parameter value

### isParameterTrue

    public boolean isParameterTrue(String name)

  Description copied from interface: `HttpParams`
  Checks if a boolean parameter is set to `true`.

  Specified by:
    `isParameterTrue` in interface `HttpParams`
  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

    public boolean isParameterFalse(String name)

  Description copied from interface: `HttpParams`
  Checks if a boolean parameter is not set or `false`.

  Specified by:
    `isParameterFalse` in interface `HttpParams`
  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`

### getNames

    public Set<String> getNames()

  Returns the current set of names; in the case of stacked parameters, returns the names from all the participating HttpParams instances. Changes to the underlying HttpParams are not reflected in the set - it is a snapshot.

  Dummy implementation - must be overridden by subclasses.

  Specified by:
    `getNames` in interface `HttpParamsNames`
  Returns:
    the names, as a Set<String>
  Throws:
    `UnsupportedOperationException` - - always
  Since:
    4.2

Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.