org.objectweb.telosys.common
Interface IRequestParameters

All Known Implementing Classes:
RequestParameters, ScreenRequest

public interface IRequestParameters

Generic abstract class for request parameters management.

Since:
v 1.0.2

Method Summary
 boolean getParamAsBoolean(java.lang.String paramName)
          Returns the boolean value of the given parameter name.
 boolean getParamAsBoolean(java.lang.String paramName, boolean defaultValue)
          Returns the boolean value of the given parameter name.
 byte getParamAsByte(java.lang.String paramName)
          Returns the byte value of the given parameter name.
 byte getParamAsByte(java.lang.String paramName, byte defaultValue)
          Returns the byte value of the given parameter name.
 char getParamAsChar(java.lang.String paramName)
          Returns the char value of the given parameter name.
 char getParamAsChar(java.lang.String paramName, char defaultValue)
          Returns the char value of the given parameter name.
 java.util.Date getParamAsDate(java.lang.String paramName)
          Returns the date/time/datetime value of the given parameter name.
 java.util.Date getParamAsDate(java.lang.String paramName, java.util.Date defaultValue)
          Returns the date/time/datetime value of the given parameter name.
 double getParamAsDouble(java.lang.String paramName)
          Returns the double value of the given parameter name.
 double getParamAsDouble(java.lang.String paramName, double defaultValue)
          Returns the double value of the given parameter name.
 float getParamAsFloat(java.lang.String paramName)
          Returns the float value of the given parameter name.
 float getParamAsFloat(java.lang.String paramName, float defaultValue)
          Returns the float value of the given parameter name.
 int getParamAsInt(java.lang.String paramName)
          Returns the int value of the given parameter name.
 int getParamAsInt(java.lang.String paramName, int defaultValue)
          Returns the int value of the given parameter name.
 long getParamAsLong(java.lang.String paramName)
          Returns the long value of the given parameter name.
 long getParamAsLong(java.lang.String paramName, long defaultValue)
          Returns the long value of the given parameter name.
 short getParamAsShort(java.lang.String paramName)
          Returns the short value of the given parameter name.
 short getParamAsShort(java.lang.String paramName, short defaultValue)
          Returns the short value of the given parameter name.
 java.lang.String getParameter(java.lang.String paramName)
          Returns the value of the given parameter name, or NULL if not found
 java.lang.String getParameter(java.lang.String paramName, java.lang.String defaultValue)
          Returns the value of the given parameter name, or the default value if not found
 java.util.Map getParameterMap()
          Returns the parameters as a Map instance
 boolean hasParameter()
          Returns true if there's at least one parameter in the request
 

Method Detail

getParameter

public java.lang.String getParameter(java.lang.String paramName)
Returns the value of the given parameter name, or NULL if not found

Parameters:
paramName -
Returns:

getParameter

public java.lang.String getParameter(java.lang.String paramName,
                                     java.lang.String defaultValue)
Returns the value of the given parameter name, or the default value if not found

Parameters:
paramName -
defaultValue - : the default value used if the parameter is not found
Returns:

hasParameter

public boolean hasParameter()
Returns true if there's at least one parameter in the request

Returns:
Since:
1.1.0

getParameterMap

public java.util.Map getParameterMap()
Returns the parameters as a Map instance

Returns:
Since:
1.1.0

getParamAsBoolean

public boolean getParamAsBoolean(java.lang.String paramName)
Returns the boolean value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
true if the parameter value is "1" or "true" ( ignore case ), else false
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsBoolean

public boolean getParamAsBoolean(java.lang.String paramName,
                                 boolean defaultValue)
Returns the boolean value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
true if the parameter value is "1" or "true" ( ignore case ), else false
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsInt

public int getParamAsInt(java.lang.String paramName)
Returns the int value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsInt

public int getParamAsInt(java.lang.String paramName,
                         int defaultValue)
Returns the int value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsLong

public long getParamAsLong(java.lang.String paramName)
Returns the long value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsLong

public long getParamAsLong(java.lang.String paramName,
                           long defaultValue)
Returns the long value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsShort

public short getParamAsShort(java.lang.String paramName)
Returns the short value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsShort

public short getParamAsShort(java.lang.String paramName,
                             short defaultValue)
Returns the short value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsByte

public byte getParamAsByte(java.lang.String paramName)
Returns the byte value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsByte

public byte getParamAsByte(java.lang.String paramName,
                           byte defaultValue)
Returns the byte value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsChar

public char getParamAsChar(java.lang.String paramName)
Returns the char value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsChar

public char getParamAsChar(java.lang.String paramName,
                           char defaultValue)
Returns the char value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsFloat

public float getParamAsFloat(java.lang.String paramName)
Returns the float value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsFloat

public float getParamAsFloat(java.lang.String paramName,
                             float defaultValue)
Returns the float value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsDouble

public double getParamAsDouble(java.lang.String paramName)
Returns the double value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsDouble

public double getParamAsDouble(java.lang.String paramName,
                               double defaultValue)
Returns the double value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2

getParamAsDate

public java.util.Date getParamAsDate(java.lang.String paramName)
Returns the date/time/datetime value of the given parameter name.
Throws an exception if the parameter is not found or cannot be converted.

Parameters:
paramName -
Returns:
Throws:
TelosysRuntimeException - if not found or invalid
Since:
1.0.2

getParamAsDate

public java.util.Date getParamAsDate(java.lang.String paramName,
                                     java.util.Date defaultValue)
Returns the date/time/datetime value of the given parameter name.
Returns the given default value if the parameter cannot be found.
Throws an exception if the parameter cannot be converted.

Parameters:
paramName -
defaultValue -
Returns:
Throws:
TelosysRuntimeException - if the parameter value cannot be converted
Since:
1.0.2