class EmptyConfigProperties extends Object implements ConfigProperties
ConfigProperties that always is empty.EMPTY, KEY_SEPARATOR| Constructor and Description |
|---|
EmptyConfigProperties() |
| 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).ConfigProperties.getValue(). |
String |
getChildValue(String key)
Shortcut for
getChild(key).ConfigProperties.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() |
String |
toString() |
public Set<String> getChildKeys()
getChildKeys in interface ConfigPropertiesSet of the direct child keys available in the
ConfigProperties-node.public ConfigProperties getChild(String key)
getChild in interface ConfigPropertieskey - the child key of the requested configuration value.ConfigProperties. Will be an empty child if undefined.public ConfigProperties getChild(String... keys)
ConfigPropertiesConfigProperties.getChild(String) such that
config.getChild(key1, ..., keyN) is the same as
config.getChild(key1)...getChild(keyN).getChild in interface ConfigPropertieskeys - the keys to traverse recursively.child reached from recursively traversing the given keys.public String getChildValue(String key)
ConfigPropertiesgetChild(key).ConfigProperties.getValue().getChildValue in interface ConfigPropertieskey - the key of the childConfigProperties-node. May be null.public String getChildValue(String... keys)
ConfigPropertiesgetChild(keys).ConfigProperties.getValue().getChildValue in interface ConfigPropertieskeys - the keys to traverse recursively.value of the descendant child traversed by
keys. May be null.public String getValue()
getValue in interface ConfigPropertiesConfigProperties-node. May be null.public <T> T getValue(Class<T> type)
getValue in interface ConfigPropertiesT - the requested typetype - the Class reflecting the requested result type.ConfigProperties-node converted to the given type. Will be null
if undefined.public <T> T getValue(Class<T> type, T defaultValue)
getValue in interface ConfigPropertiesT - 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.public boolean getValueAsBoolean()
getValueAsBoolean in interface ConfigPropertiesConfigProperties.getValue(Class, Object) as boolean with false as default.public boolean isEmpty()
isEmpty in interface ConfigPropertiestrue if this is an empty ConfigProperties-node that neither has a value
nor any child.public Map<String,String> toFlatMap()
toFlatMap in interface ConfigPropertiesConfigProperties converted to a flat Map.public Map<String,String> toFlatMap(String rootKey)
toFlatMap in interface ConfigPropertiesrootKey - the root key used as prefix for the keys separated with a dot
if not empty. Typically the empty String.ConfigProperties converted to a flat Map.public Map<String,Object> toHierarchicalMap()
toHierarchicalMap in interface ConfigPropertiesConfigProperties converted to a hierarchical
Map.public MutableConfigProperties inherit(ConfigProperties parent)
inherit in interface ConfigPropertiesparent - 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.