public interface ConfigProperties
application.properties).| Modifier and Type | Field and Description |
|---|---|
static ConfigProperties |
EMPTY
An immutable instance of
ConfigProperties that is always empty |
static char |
KEY_SEPARATOR
The separator charactor '.' for hierarchical keys such as "spring.datasource.url".
|
| Modifier and Type | Method and Description |
|---|---|
ConfigProperties |
getChild(String... keys)
|
ConfigProperties |
getChild(String key) |
Set<String> |
getChildKeys() |
String |
getChildValue(String... keys)
Shortcut for
getChild(keys).getValue(). |
String |
getChildValue(String key)
Shortcut for
getChild(key).getValue(). |
String |
getValue() |
<T> T |
getValue(Class<T> type) |
<T> T |
getValue(Class<T> type,
T defaultValue) |
boolean |
getValueAsBoolean() |
MutableConfigProperties |
inherit(ConfigProperties parent) |
boolean |
isEmpty() |
Map<String,String> |
toFlatMap() |
Map<String,String> |
toFlatMap(String rootKey) |
Map<String,Object> |
toHierarchicalMap() |
static final char KEY_SEPARATOR
static final ConfigProperties EMPTY
ConfigProperties that is always emptySet<String> getChildKeys()
Set of the direct child keys available in the
ConfigProperties-node.ConfigProperties getChild(String key)
key - the child key of the requested configuration value.ConfigProperties. Will be an empty child if undefined.ConfigProperties getChild(String... keys)
getChild(String) such that
config.getChild(key1, ..., keyN) is the same as
config.getChild(key1)...getChild(keyN).keys - the keys to traverse recursively.child reached from recursively traversing the given keys.String getChildValue(String key)
getChild(key).getValue().key - the key of the childConfigProperties-node. May be null.String getChildValue(String... keys)
getChild(keys).getValue().keys - the keys to traverse recursively.value of the descendant child traversed by
keys. May be null.String getValue()
ConfigProperties-node. May be null.<T> T getValue(Class<T> type)
T - the requested typetype - the Class reflecting the requested result type.ConfigProperties-node converted to the given type. Will be null
if undefined.<T> T getValue(Class<T> type, T defaultValue)
T - the requested typetype - the Class reflecting the requested result type.defaultValue - the value returned as default if the actual value is undefined.ConfigProperties-node converted to the given type. Will be
defaultValue if undefined.boolean getValueAsBoolean()
getValue(Class, Object) as boolean with false as default.boolean isEmpty()
true if this is an empty ConfigProperties-node that neither has a value
nor any child.Map<String,Object> toHierarchicalMap()
ConfigProperties converted to a hierarchical
Map.MutableConfigProperties inherit(ConfigProperties parent)
parent - the parent ConfigProperties to extend.ConfigProperties with all children and
value(s) from this ConfigProperties-tree and all children and value(s) inherited from the given parent
ConfigProperties-tree if they are undefined in this tree.Copyright © 2014–2019 devon4j-Team. All rights reserved.