public interface Configuration
| 限定符和类型 | 方法和说明 |
|---|---|
default boolean |
containsKey(String key)
Check if the configuration contains the specified key.
|
default <T> T |
convert(Class<T> cls,
String key,
T 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.
|
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 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 otherwiseCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.