org.codehaus.spice.salt.config
Interface Parameters

All Known Implementing Classes:
DefaultParameters

public interface Parameters

Parameters present flat configuration data. Contained in the Parameters object is a set of name-value pairs.

Version:
$Revision: 1.1 $ $Date: 2003/12/02 02:15:04 $

Method Summary
 Parameters getChildParameters(String prefix)
          Return a Parameters object that represents a subset of parameters with specified prefix.
 String getParameter(String name)
          Return value of parameter with specified name.
 String getParameter(String name, String defaultValue)
          Return value of parameter with specified name.
 boolean getParameterAsBoolean(String name)
          Return value of parameter with specified name as a boolean.
 boolean getParameterAsBoolean(String name, boolean defaultValue)
          Return value of parameter with specified name as a boolean.
 float getParameterAsFloat(String name)
          Return value of parameter with specified name as a float.
 float getParameterAsFloat(String name, float defaultValue)
          Return value of parameter with specified name as a float.
 int getParameterAsInteger(String name)
          Return value of parameter with specified name as an integer.
 int getParameterAsInteger(String name, int defaultValue)
          Return value of parameter with specified name as an integer.
 long getParameterAsLong(String name)
          Return value of parameter with specified name as a long.
 long getParameterAsLong(String name, long defaultValue)
          Return value of parameter with specified name as a long.
 String[] getParameterNames()
          Return the names of all the parameters.
 boolean isParameter(String name)
          Return true of parameter with specified name exists.
 

Method Detail

getParameterNames

String[] getParameterNames()
Return the names of all the parameters.

Returns:
the names of all the parameters.

isParameter

boolean isParameter(String name)
Return true of parameter with specified name exists.

Parameters:
name - the name
Returns:
true of parameter with specified name exists.

getParameter

String getParameter(String name)
                    throws ParameterException
Return value of parameter with specified name.

Parameters:
name - the name
Returns:
the value
Throws:
ParameterException - if unable to locate parameter

getParameter

String getParameter(String name,
                    String defaultValue)
Return value of parameter with specified name.

Parameters:
name - the name
defaultValue - the defaultValue if specified parameter does not exist
Returns:
the value

getParameterAsInteger

int getParameterAsInteger(String name)
                          throws ParameterException
Return value of parameter with specified name as an integer.

Parameters:
name - the name
Returns:
the value
Throws:
ParameterException - if unable to locate parameter or parameter can not be converted to correct type

getParameterAsInteger

int getParameterAsInteger(String name,
                          int defaultValue)
Return value of parameter with specified name as an integer.

Parameters:
name - the name
defaultValue - the defaultValue if specified parameter does not exist or parameter can not be converted to the correct type
Returns:
the value

getParameterAsLong

long getParameterAsLong(String name)
                        throws ParameterException
Return value of parameter with specified name as a long.

Parameters:
name - the name
Returns:
the value
Throws:
ParameterException - if unable to locate parameter or parameter can not be converted to correct type

getParameterAsLong

long getParameterAsLong(String name,
                        long defaultValue)
Return value of parameter with specified name as a long.

Parameters:
name - the name
defaultValue - the defaultValue if specified parameter does not exist or parameter can not be converted to the correct type
Returns:
the value

getParameterAsBoolean

boolean getParameterAsBoolean(String name)
                              throws ParameterException
Return value of parameter with specified name as a boolean.

Parameters:
name - the name
Returns:
the value
Throws:
ParameterException - if unable to locate parameter or parameter can not be converted to correct type

getParameterAsBoolean

boolean getParameterAsBoolean(String name,
                              boolean defaultValue)
Return value of parameter with specified name as a boolean.

Parameters:
name - the name
defaultValue - the defaultValue if specified parameter does not exist or parameter can not be converted to the correct type
Returns:
the value

getParameterAsFloat

float getParameterAsFloat(String name)
                          throws ParameterException
Return value of parameter with specified name as a float.

Parameters:
name - the name
Returns:
the value
Throws:
ParameterException - if unable to locate parameter or parameter can not be converted to correct type

getParameterAsFloat

float getParameterAsFloat(String name,
                          float defaultValue)
Return value of parameter with specified name as a float.

Parameters:
name - the name
defaultValue - the defaultValue if specified parameter does not exist or parameter can not be converted to the correct type
Returns:
the value

getChildParameters

Parameters getChildParameters(String prefix)
Return a Parameters object that represents a subset of parameters with specified prefix. The child parameters has a prefix with the separator ('.') appended. ie. if the prefix was "foo" then the parameter "foo.baz" would be included in child Parameters object using the key "baz".

Parameters:
prefix - the prefix
Returns:
the parameters object


Copyright © 1999-2008 Codehaus. All Rights Reserved.