org.xlightweb
Class MultivalueMap

Package class diagram package MultivalueMap
java.lang.Object
  extended by org.xlightweb.MultivalueMap
All Implemented Interfaces:
IMultivalueMap
Direct Known Subclasses:
FormURLEncodedBody

public class MultivalueMap
extends Object
implements IMultivalueMap

A multivalue map


Constructor Summary
MultivalueMap(BodyDataSource bodyDataSource)
          constructo r
MultivalueMap(NameValuePair... decodedFormParameters)
          constructor
MultivalueMap(NameValuePair decodedFormParameter)
          constructor
MultivalueMap(String encoding)
          constructor
MultivalueMap(String encoding, NameValuePair... decodedFormParameters)
          constructor
MultivalueMap(String encoding, String... decodedFormParameters)
          constructor
MultivalueMap(String encoding, String serialized)
          constructor
 
Method Summary
 void addParameter(String name, String value)
          adds an parameter
 Boolean getBooleanParameter(String name)
          returns the first parameter value
 boolean getBooleanParameter(String name, boolean defaultVal)
          returns the first parameter value
 Double getDoubleParameter(String name)
          returns the first parameter value
 double getDoubleParameter(String name, double defaultVal)
          returns the first parameter value
 Float getFloatParameter(String name)
          returns the first parameter value
 float getFloatParameter(String name, float defaultVal)
          returns the first parameter value
 Integer getIntParameter(String name)
          returns the first parameter value
 int getIntParameter(String name, int defaultVal)
          returns the first parameter value
 Long getLongParameter(String name)
          returns the first parameter value
 long getLongParameter(String name, long defaultVal)
          returns the first parameter value
 String getParameter(String name)
          returns the first parameter value
 Set<String> getParameterNameSet()
          returns the parameter name set
 String[] getParameterValues(String name)
          returns the parameter values
 void removeParameter(String name)
          remove a parameter
 void setParameter(String name, String value)
          sets a parameter.
 String toString()
          returns the serialized representation of the map (mime type application/x-www-form-urlencoded)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultivalueMap

public MultivalueMap(NameValuePair decodedFormParameter)
constructor

Parameters:
decodedFormParameter - the decoded form parameters

MultivalueMap

public MultivalueMap(String encoding)
constructor

Parameters:
encoding - the encoding to use
decodedFormParameter - the decoded form parameters

MultivalueMap

public MultivalueMap(NameValuePair... decodedFormParameters)
constructor

Parameters:
decodedFormParameters - the decoded form parameters

MultivalueMap

public MultivalueMap(String encoding,
                     NameValuePair... decodedFormParameters)
constructor

Parameters:
encoding - the encoding to use
decodedFormParameters - the decoded form parameters

MultivalueMap

public MultivalueMap(BodyDataSource bodyDataSource)
              throws IOException
constructo r

Parameters:
bodyDataSource - the entity
Throws:
IOException - if the body parsing fails

MultivalueMap

public MultivalueMap(String encoding,
                     String... decodedFormParameters)
constructor

Parameters:
encoding - the encoding to use
decodedFormParameters - the decoded form parameters

MultivalueMap

public MultivalueMap(String encoding,
                     String serialized)
              throws IOException
constructor

Parameters:
encoding - the encoding
serialized - the serialized representation (mime type application/x-www-form-urlencoded)
Throws:
IOException - if an exception occurs
Method Detail

setParameter

public final void setParameter(String name,
                               String value)
Description copied from interface: IMultivalueMap
sets a parameter.

Specified by:
setParameter in interface IMultivalueMap
Parameters:
name - the name
value - the value

removeParameter

public final void removeParameter(String name)
Description copied from interface: IMultivalueMap
remove a parameter

Specified by:
removeParameter in interface IMultivalueMap
Parameters:
name - the name

addParameter

public final void addParameter(String name,
                               String value)
Description copied from interface: IMultivalueMap
adds an parameter

Specified by:
addParameter in interface IMultivalueMap
Parameters:
name - the name
value - the value

getParameterNameSet

public final Set<String> getParameterNameSet()
returns the parameter name set

Specified by:
getParameterNameSet in interface IMultivalueMap
Returns:
the parameter name set

getParameterValues

public final String[] getParameterValues(String name)
returns the parameter values

Specified by:
getParameterValues in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the parameter values

getParameter

public final String getParameter(String name)
returns the first parameter value

Specified by:
getParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getIntParameter

public final Integer getIntParameter(String name)
returns the first parameter value

Specified by:
getIntParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getIntParameter

public final int getIntParameter(String name,
                                 int defaultVal)
returns the first parameter value

Specified by:
getIntParameter in interface IMultivalueMap
Parameters:
name - the parameter name
defaultVal - the default value
Returns:
the first parameter value

getLongParameter

public final Long getLongParameter(String name)
returns the first parameter value

Specified by:
getLongParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getLongParameter

public final long getLongParameter(String name,
                                   long defaultVal)
returns the first parameter value

Specified by:
getLongParameter in interface IMultivalueMap
Parameters:
name - the parameter name
defaultVal - the default value
Returns:
the first parameter value

getDoubleParameter

public final Double getDoubleParameter(String name)
returns the first parameter value

Specified by:
getDoubleParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getDoubleParameter

public final double getDoubleParameter(String name,
                                       double defaultVal)
returns the first parameter value

Specified by:
getDoubleParameter in interface IMultivalueMap
Parameters:
name - the parameter name
defaultVal - the default value
Returns:
the first parameter value

getFloatParameter

public final Float getFloatParameter(String name)
returns the first parameter value

Specified by:
getFloatParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getFloatParameter

public final float getFloatParameter(String name,
                                     float defaultVal)
returns the first parameter value

Specified by:
getFloatParameter in interface IMultivalueMap
Parameters:
name - the parameter name
defaultVal - the default value
Returns:
the first parameter value

getBooleanParameter

public final Boolean getBooleanParameter(String name)
returns the first parameter value

Specified by:
getBooleanParameter in interface IMultivalueMap
Parameters:
name - the parameter name
Returns:
the first parameter value

getBooleanParameter

public final boolean getBooleanParameter(String name,
                                         boolean defaultVal)
returns the first parameter value

Specified by:
getBooleanParameter in interface IMultivalueMap
Parameters:
name - the parameter name
defaultVal - the default value
Returns:
the first parameter value

toString

public String toString()
returns the serialized representation of the map (mime type application/x-www-form-urlencoded)

Overrides:
toString in class Object
Returns:
the serialized representation of the map