## org.apache.http.params
Class BasicHttpParams

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

All Implemented Interfaces:
  Serializable, Cloneable, HttpParams, HttpParamsNames

Direct Known Subclasses:
  SyncBasicHttpParams

    @NotThreadSafe
    public class BasicHttpParams

extends AbstractHttpParams
implements Serializable, Cloneable

Default implementation of `HttpParams` interface.

Please note access to the internal structures of this class is not synchronized and therefore this class may be thread-unsafe.

Since:
  4.0
See Also:
  Serialized Form

Constructor Summary
`BasicHttpParams()`

Method Summary
`void` `clear()` Removes all parameters from this collection.
`Object` `clone()` Clones the instance.
`HttpParams` `copy()` Deprecated. (4.1)
`void` `copyParams(HttpParams target)` Copies the locally defined parameters to the argument parameters.
`Set<String>` `getNames()` Returns the current set of names.
`Object` `getParameter(String name)` Obtains the value of the given parameter.
`boolean` `isParameterSet(String name)` Is the parameter set?
`boolean` `isParameterSetLocally(String name)` Is the parameter set in this object?
`boolean` `removeParameter(String name)` Removes the parameter with the specified name.
`HttpParams` `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

Methods inherited from class org.apache.http.params.AbstractHttpParams
`getBooleanParameter, getDoubleParameter, getIntParameter, getLongParameter, isParameterFalse, isParameterTrue, setBooleanParameter, setDoubleParameter, setIntParameter, setLongParameter`

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

Constructor Detail

### BasicHttpParams

    public BasicHttpParams()

Method Detail

### getParameter

    public Object getParameter(String name)

  Description copied from interface: `HttpParams`
  Obtains the value of the given parameter.

  Specified by:
    `getParameter` in interface `HttpParams`
  Parameters:
    `name` - the parent name.
  Returns:
    an object that represents the value of the parameter, `null` if the parameter is not set or if it is explicitly set to `null`
  See Also:
    `HttpParams.setParameter(String, Object)`

### setParameter

    public HttpParams setParameter(String name,
                                   Object value)

  Description copied from interface: `HttpParams`
  Assigns the value to the parameter with the given name.

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

### removeParameter

    public boolean removeParameter(String name)

  Description copied from interface: `HttpParams`
  Removes the parameter with the specified name.

  Specified by:
    `removeParameter` in interface `HttpParams`
  Parameters:
    `name` - parameter name
  Returns:
    true if the parameter existed and has been removed, false else.

### setParameters

    public void setParameters(String[] names,
                              Object value)

  Assigns the value to all the parameter with the given names

  Parameters:
    `names` - array of parameter names
    `value` - parameter value

### isParameterSet

    public boolean isParameterSet(String name)

  Is the parameter set?

  Uses `getParameter(String)` (which is overrideable) to fetch the parameter value, if any.

  Also @see `isParameterSetLocally(String)`

  Parameters:
    `name` - parameter name
  Returns:
    true if parameter is defined and non-null

### isParameterSetLocally

    public boolean isParameterSetLocally(String name)

  Is the parameter set in this object?

  The parameter value is fetched directly.

  Also @see `isParameterSet(String)`

  Parameters:
    `name` - parameter name
  Returns:
    true if parameter is defined and non-null

### clear

    public void clear()

  Removes all parameters from this collection.

### copy

    @Deprecated
    public HttpParams copy()

  Deprecated. (4.1)

  Creates a copy of these parameters. This implementation calls `clone()`.

  Specified by:
    `copy` in interface `HttpParams`
  Returns:
    a new set of params holding a copy of the local parameters in this object.
  Throws:
    `UnsupportedOperationException` - if the clone() fails

### clone

    public Object clone()
                 throws CloneNotSupportedException

  Clones the instance. Uses `copyParams(HttpParams)` to copy the parameters.

  Overrides:
    `clone` in class `Object`
  Throws:
    `CloneNotSupportedException`

### copyParams

    public void copyParams(HttpParams target)

  Copies the locally defined parameters to the argument parameters. This method is called from `clone()`.

  Parameters:
    `target` - the parameters to which to copy
  Since:
    4.2

### getNames

    public Set<String> getNames()

  Returns the current set of names. Changes to the underlying HttpParams are not reflected in the set - it is a snapshot.

  Specified by:
    `getNames` in interface `HttpParamsNames`
  Overrides:
    `getNames` in class `AbstractHttpParams`
  Returns:
    the names, as a Set<String>
  Since:
    4.2

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