|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgriffon.util.ConfigUtils
public abstract class ConfigUtils extends Object
Utility class for reading configuration properties.
Constructor Summary | |
ConfigUtils()
|
Method Summary | |
---|---|
static Object
|
getConfigValue(Map config, String key)
Returns the value for the specified key. |
static Object
|
getConfigValue(Map config, String key, Object defaultValue)
Returns the value for the specified key with an optional default value if no match is found. |
static boolean
|
getConfigValueAsBoolean(Map config, String key)
Returns the value for the specified key coerced to a boolean. |
static boolean
|
getConfigValueAsBoolean(Map config, String key, boolean defaultValue)
Returns the value for the specified key with an optional default value if no match is found. |
static int
|
getConfigValueAsInt(Map config, String key)
Returns the value for the specified key coerced to an int. |
static int
|
getConfigValueAsInt(Map config, String key, int defaultValue)
Returns the value for the specified key with an optional default value if no match is found. |
static String
|
getConfigValueAsString(Map config, String key)
Returns the value for the specified key converted to a String. |
static String
|
getConfigValueAsString(Map config, String key, String defaultValue)
Returns the value for the specified key with an optional default value if no match is found. |
static boolean
|
isValueDefined(Map config, String key)
Returns true if there's a on-null value for the specified key. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
ConfigUtils()
Method Detail |
---|
public static Object getConfigValue(Map config, String key)
config
- the configuration object to be searched uponkey
- the key to be searched
public static Object getConfigValue(Map config, String key, Object defaultValue)
config
- the configuration object to be searched uponkey
- the key to be searcheddefaultValue
- the value to send back if no match is found
public static boolean getConfigValueAsBoolean(Map config, String key)
config
- the configuration object to be searched uponkey
- the key to be searched
public static boolean getConfigValueAsBoolean(Map config, String key, boolean defaultValue)
config
- the configuration object to be searched uponkey
- the key to be searcheddefaultValue
- the value to send back if no match is found
public static int getConfigValueAsInt(Map config, String key)
config
- the configuration object to be searched uponkey
- the key to be searched
public static int getConfigValueAsInt(Map config, String key, int defaultValue)
config
- the configuration object to be searched uponkey
- the key to be searcheddefaultValue
- the value to send back if no match is found
public static String getConfigValueAsString(Map config, String key)
config
- the configuration object to be searched uponkey
- the key to be searched
public static String getConfigValueAsString(Map config, String key, String defaultValue)
config
- the configuration object to be searched uponkey
- the key to be searcheddefaultValue
- the value to send back if no match is found
public static boolean isValueDefined(Map config, String key)
config
- the configuration object to be searched uponkey
- the key to be searched
Groovy Documentation