public class MockContainerConfiguration extends Object implements ContainerConfiguration
Constructor and Description |
---|
MockContainerConfiguration() |
Modifier and Type | Method and Description |
---|---|
boolean |
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 |
getDouble(String key)
Get a double associated with the given configuration key.
|
double |
getDouble(String key,
double defaultValue)
Get a double associated with the given configuration key.
|
float |
getFloat(String key)
Get a float associated with the given configuration key.
|
float |
getFloat(String key,
float defaultValue)
Get a float associated with the given configuration key.
|
int |
getInt(String key)
Get a int associated with the given configuration key.
|
int |
getInt(String key,
int defaultValue)
Get a int associated with the given configuration key.
|
Iterator |
getKeys()
Get the list of the keys contained in the configuration.
|
List<String> |
getList(String key)
Get a List of strings associated with the given configuration key.
|
long |
getLong(String key)
Get a long associated with the given configuration key.
|
long |
getLong(String key,
long defaultValue)
Get a long associated with the given configuration key.
|
String |
getString(String key)
Get a string associated with the given configuration key.
|
String |
getString(String key,
String defaultValue)
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 |
isDevelopmentMode()
Checks if the container is running under development mode
|
boolean |
isEmpty()
Check if the configuration is empty.
|
void |
setProperty(Class<?> valueClass,
String key,
Object value) |
Properties |
toProperties()
Convert a ContainerConfiguration class into a Properties class.
|
public boolean isEmpty()
ContainerConfiguration
isEmpty
in interface ContainerConfiguration
true
if the configuration contains no property,
false
otherwise.public boolean containsKey(String key)
ContainerConfiguration
containsKey
in interface ContainerConfiguration
key
- the key whose presence in this configuration is to be testedpublic boolean getBoolean(String key)
ContainerConfiguration
getBoolean
in interface ContainerConfiguration
key
and false
if key is missingpublic boolean getBoolean(String key, boolean defaultValue)
ContainerConfiguration
getBoolean
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a boolean/Boolean or is missing, defaultValue
is returnedpublic String getString(String key)
ContainerConfiguration
getString
in interface ContainerConfiguration
key
and null
if key is missingpublic String getString(String key, String defaultValue)
ContainerConfiguration
getString
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a string or is missing, defaultValue
is returnedpublic double getDouble(String key)
ContainerConfiguration
getDouble
in interface ContainerConfiguration
key
and 0D
if key is missingpublic double getDouble(String key, double defaultValue)
ContainerConfiguration
getDouble
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a double/Double or is missing, defaultValue
is returnedpublic float getFloat(String key)
ContainerConfiguration
getFloat
in interface ContainerConfiguration
key
and 0F
if key is missingpublic float getFloat(String key, float defaultValue)
ContainerConfiguration
getFloat
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a float/Float or is missing, defaultValue
is returnedpublic int getInt(String key)
ContainerConfiguration
getInt
in interface ContainerConfiguration
key
and 0
if key is missingpublic int getInt(String key, int defaultValue)
ContainerConfiguration
getInt
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a int/Int or is missing, defaultValue
is returnedpublic List<String> getList(String key)
ContainerConfiguration
getList
in interface ContainerConfiguration
List
of String
s for key
public long getLong(String key)
ContainerConfiguration
getLong
in interface ContainerConfiguration
key
and 0L
if key is missingpublic long getLong(String key, long defaultValue)
ContainerConfiguration
getLong
in interface ContainerConfiguration
key
and if key
maps to object that does not
map to a long/Long or is missing, defaultValue
is returnedpublic String[] getStringArray(String key)
ContainerConfiguration
getStringArray
in interface ContainerConfiguration
public Iterator getKeys()
ContainerConfiguration
getKeys
in interface ContainerConfiguration
Iterator
of all the String
keyspublic boolean isDevelopmentMode()
ContainerConfiguration
isDevelopmentMode
in interface ContainerConfiguration
public Properties toProperties()
ContainerConfiguration
toProperties
in interface ContainerConfiguration
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.