Package org.hippoecm.hst.core.container
Interface ContainerConfiguration
public interface ContainerConfiguration
Container Configuration
Retrieve basic data types from the container configuration(s).
This is a subset of Commons Configuration functionality.
- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Check if the configuration contains the specified key.boolean
getBoolean
(String key) Get a boolean associated with the given configuration key.boolean
getBoolean
(String key, boolean defaultValue) Get a boolean associated with the given configuration key.double
Get a double associated with the given configuration key.double
Get a double associated with the given configuration key.float
Get a float associated with the given configuration key.float
Get a float associated with the given configuration key.int
Get a int associated with the given configuration key.int
Get a int associated with the given configuration key.getKeys()
Get the list of the keys contained in the configuration.Get a List of strings associated with the given configuration key.long
Get a long associated with the given configuration key.long
Get a long associated with the given configuration key.Get a string associated with the given configuration key.Get a string associated with the given configuration key.String[]
getStringArray
(String key) Get an array of strings associated with the given configuration key.boolean
Checks if the container is running under development modeboolean
isEmpty()
Check if the configuration is empty.Convert a ContainerConfiguration class into a Properties class.
-
Method Details
-
isEmpty
boolean isEmpty()Check if the configuration is empty.- Returns:
true
if the configuration contains no property,false
otherwise.
-
containsKey
Check if the configuration contains the specified key.- Parameters:
key
- the key whose presence in this configuration is to be tested- Returns:
- true if the configuration contains a value for this key, false otherwise
-
getBoolean
Get a boolean associated with the given configuration key.- Parameters:
key
-- Returns:
- boolean associated for
key
andfalse
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getBoolean
Get a boolean associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a boolean/Boolean, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- boolean associated with configuration
key
and ifkey
maps to object that does not map to a boolean/Boolean or is missing,defaultValue
is returned
-
getString
Get a string associated with the given configuration key.- Parameters:
key
-- Returns:
- String associated for
key
andnull
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getString
Get a string associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a String, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- String associated with configuration
key
and ifkey
maps to object that does not map to a string or is missing,defaultValue
is returned
-
getDouble
Get a double associated with the given configuration key.- Parameters:
key
-- Returns:
- double associated for
key
and0D
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getDouble
Get a double associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a double/Double, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- double associated with configuration
key
and ifkey
maps to object that does not map to a double/Double or is missing,defaultValue
is returned
-
getFloat
Get a float associated with the given configuration key.- Parameters:
key
-- Returns:
- float associated for
key
and0F
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getFloat
Get a float associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a float/Float, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- double associated with configuration
key
and ifkey
maps to object that does not map to a float/Float or is missing,defaultValue
is returned
-
getInt
Get a int associated with the given configuration key.- Parameters:
key
-- Returns:
- int associated for
key
and0
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getInt
Get a int associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a int/Int, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- int associated with configuration
key
and ifkey
maps to object that does not map to a int/Int or is missing,defaultValue
is returned
-
getList
Get a List of strings associated with the given configuration key. -
getLong
Get a long associated with the given configuration key.- Parameters:
key
-- Returns:
- long associated for
key
and0L
if key is missing - Throws:
RuntimeException
- if key is present but mapped to wrong type
-
getLong
Get a long associated with the given configuration key. If the key doesn't map to an existing object or to an object that is not a long/Long, the default value is returned.- Parameters:
key
-defaultValue
-- Returns:
- int associated with configuration
key
and ifkey
maps to object that does not map to a long/Long or is missing,defaultValue
is returned
-
getStringArray
Get an array of strings associated with the given configuration key.- Parameters:
key
-
-
getKeys
Get the list of the keys contained in the configuration. -
isDevelopmentMode
boolean isDevelopmentMode()Checks if the container is running under development mode -
toProperties
Properties toProperties()Convert a ContainerConfiguration class into a Properties class. List properties are joined into a string using the delimiter of the configuration.
modifications to the returned Properties object are not reflected in the ContainerConfiguration and only to the returned Properties: Every new invocation returns a new unique instance
- Returns:
- Properties created from the Configuration
-