public interface Configuration
| Modifier and Type | Method and Description |
|---|---|
default boolean |
containsKey(String key)
Check if the configuration contains the specified key.
|
default <T> T |
convert(Class<T> cls,
String key,
T defaultValue) |
default boolean |
getBoolean(String key) |
default boolean |
getBoolean(String key,
boolean defaultValue) |
default Boolean |
getBoolean(String key,
Boolean defaultValue) |
default int |
getInt(String key) |
default int |
getInt(String key,
int defaultValue) |
default Integer |
getInteger(String key,
Integer defaultValue) |
Object |
getInternalProperty(String key) |
default Object |
getProperty(String key)
Gets a property from the configuration.
|
default Object |
getProperty(String key,
Object defaultValue)
Gets a property from the configuration.
|
default String |
getString(String key)
Get a string associated with the given configuration key.
|
default String |
getString(String key,
String defaultValue)
Get a string associated with the given configuration key.
|
static Boolean |
toBooleanObject(boolean bool) |
default String getString(String key)
key - The configuration key.default String getString(String key, String defaultValue)
key - The configuration key.defaultValue - The default value.default int getInt(String key)
default int getInt(String key, int defaultValue)
default boolean getBoolean(String key)
default boolean getBoolean(String key, boolean defaultValue)
default Object getProperty(String key)
Configuration interface the other get methods (that
return specific data types) will internally make use of this method. On
this level variable substitution is not yet performed. The returned
object is an internal representation of the property value for the passed
in key. It is owned by the Configuration object. So a caller
should not modify this object. It cannot be guaranteed that this object
will stay constant over time (i.e. further update operations on the
configuration may change its internal state).key - property to retrievedefault Object getProperty(String key, Object defaultValue)
key - property to retrievedefaultValue - default valuedefault boolean containsKey(String key)
key - the key whose presence in this configuration is to be testedtrue if the configuration contains a value for this
key, false otherwisestatic Boolean toBooleanObject(boolean bool)
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.