- All Known Subinterfaces:
- Config
- All Known Implementing Classes:
- TestConfigFactory.ConfigDelegate
 See ConfigValue.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated, for removal: This API element is subject to removal in a future version.Object represents fully-qualified key of config node.
- 
Method SummaryModifier and TypeMethodDescription<T> ConfigValue<T> Deprecated, for removal: This API element is subject to removal in a future version.Typed value as aConfigValue.default ConfigValue<Boolean> Deprecated, for removal: This API element is subject to removal in a future version.Boolean typed value.default ConfigValue<Double> asDouble()Deprecated, for removal: This API element is subject to removal in a future version.Double typed value.default ConfigValue<Integer> asInt()Deprecated, for removal: This API element is subject to removal in a future version.Integer typed value.<T> ConfigValue<List<T>> Deprecated, for removal: This API element is subject to removal in a future version.Returns list of specified type.default ConfigValue<Long> asLong()Deprecated, for removal: This API element is subject to removal in a future version.Long typed value.asMap()Deprecated, for removal: This API element is subject to removal in a future version.Transform all leaf nodes (values) into Map instance.default ConfigValue<? extends Config> asNode()Deprecated, for removal: This API element is subject to removal in a future version.Returns existing current config node asConfigValue.<C extends Config>
 ConfigValue<List<C>> Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of childConfignodes if the node isType#OBJECT.default ConfigValue<String> asString()Deprecated, for removal: This API element is subject to removal in a future version.String typed value.static Configcreate()Deprecated, for removal: This API element is subject to removal in a future version.Create a new instance of configuration from the default configuration sources.detach()Deprecated, for removal: This API element is subject to removal in a future version.Returns a copy of theConfignode with no parent.static Configempty()Deprecated, for removal: This API element is subject to removal in a future version.Empty instance ofConfig.booleanexists()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the node exists, whether an object, a list, a value node, etc.default Configget(Config.Key key) Deprecated, for removal: This API element is subject to removal in a future version.Returns the single sub-node for the specified sub-key.Deprecated, for removal: This API element is subject to removal in a future version.Returns the single sub-node for the specified sub-key.booleanhasValue()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this configuration node has a direct value.booleanisLeaf()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is a leaf node (has no children).booleanisList()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is Type#List.booleanisObject()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is Type#Object.key()Deprecated, for removal: This API element is subject to removal in a future version.Returns the fully-qualified key of theConfignode.<T> ConfigValue<T> Deprecated, for removal: This API element is subject to removal in a future version.Typed value as aConfigValuecreated from factory method.<T> ConfigValue<List<T>> Deprecated, for removal: This API element is subject to removal in a future version.Returns this node as a list mapping each list value using the provided mapper.default Stringname()Deprecated, for removal: This API element is subject to removal in a future version.Returns the last token of the fully-qualified key for theConfignode.root()Deprecated, for removal: This API element is subject to removal in a future version.Get the root of the configuration tree.traverse()Deprecated, for removal: This API element is subject to removal in a future version.Iterative deepening depth-first traversal of the node and its subtree as aStream<Config>.
- 
Method Details- 
emptyDeprecated, for removal: This API element is subject to removal in a future version.Empty instance ofConfig.- Returns:
- empty instance of Config.
 
- 
createDeprecated, for removal: This API element is subject to removal in a future version.Create a new instance of configuration from the default configuration sources. In case there is noConfigProvideravailable, returnsempty().- Returns:
- a new configuration
 
- 
keyConfig.Key key()Deprecated, for removal: This API element is subject to removal in a future version.Returns the fully-qualified key of theConfignode.The fully-qualified key is a sequence of tokens derived from the name of each node along the path from the config root to the current node. Tokens are separated by .(the dot character). Seename()for more information on the format of each token.- Returns:
- current config node key
- See Also:
 
- 
nameDeprecated, for removal: This API element is subject to removal in a future version.Returns the last token of the fully-qualified key for theConfignode.The name of a node is the last token in its fully-qualified key. The exact format of the name depends on the Typeof the containing node:- from a Type#OBJECT node the token for a child is the name of the object member;
- from a Type#LIST node the token for a child is a zero-based index of the element, an unsigned base-10 integer value with no leading zeros.
 The ABNF syntax of config key is: config-key = *1( key-token *( "." key-token ) ) key-token = *( unescaped / escaped ) unescaped = %x00-2D / %x2F-7D / %x7F-10FFFF ; %x2E ('.') and %x7E ('~') are excluded from 'unescaped' escaped = "~" ( "0" / "1" ) ; representing '~' and '.', respectively- Returns:
- current config node key
- See Also:
 
- 
getDeprecated, for removal: This API element is subject to removal in a future version.Returns the single sub-node for the specified sub-key.The format of the key is described on key()method.- Parameters:
- key- sub-key of requested sub-node
- Returns:
- config node for specified sub-key, never returns null.
- Throws:
- ConfigException- if not defined
- See Also:
 
- 
rootConfig root()Deprecated, for removal: This API element is subject to removal in a future version.Get the root of the configuration tree. In case this node is part ofdetachedtree, this method returns the node that was detached.- Returns:
- root of this configuration tree
 
- 
getDeprecated, for removal: This API element is subject to removal in a future version.Returns the single sub-node for the specified sub-key.- Parameters:
- key- sub-key of requested sub-node
- Returns:
- config node for specified sub-key, never returns null.
- See Also:
 
- 
detachDeprecated, for removal: This API element is subject to removal in a future version.Returns a copy of theConfignode with no parent.The returned node acts as a root node for the subtree below it. Its key is the empty string; "". The original config node is unchanged, and the original and the copy point to the same children.Consider the following configuration: app: name: Example 1 page-size: 20 logging: app.level = INFO level = WARNINGTheConfiginstancesname1andname2represents same data and in fact refer to the same object:Config name1 = config .get("app") .get("name"); Config name2 = config .get("app") .detach() //DETACHED node .get("name"); assert name1.asString() == "Example 1"; assert name2.asString() == "Example 1"; //DETACHED nodeThe only difference is the key each node returns:assert name1.key() == "app.name"; assert name2.key() == "name"; //DETACHED node See asMap() for example of config detaching. - Returns:
- returns detached Config instance of same config node
- Throws:
- ConfigException- if not defined
 
- 
existsboolean exists()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the node exists, whether an object, a list, a value node, etc.- Returns:
- trueif the node exists
 
- 
traverseDeprecated, for removal: This API element is subject to removal in a future version.Iterative deepening depth-first traversal of the node and its subtree as aStream<Config>.If the config node does not exist or is a leaf the returned stream is empty. Depending on the structure of the configuration the returned stream can deliver a mix of object, list, and leaf value nodes. The stream will include and traverse through object members and list elements. - Returns:
- stream of deepening depth-first sub-nodes
 
- 
isLeafboolean isLeaf()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is a leaf node (has no children).A leaf node has no nested configuration subtree and has a single value. - Returns:
- trueif the node is existing leaf node,- falseotherwise.
 
- 
isObjectboolean isObject()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is Type#Object.- Returns:
- trueif the node exists and is Type#Object,- falseotherwise.
 
- 
isListboolean isList()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this node exists and is Type#List.- Returns:
- trueif the node exists and is Type#List,- falseotherwise.
 
- 
hasValueboolean hasValue()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif this configuration node has a direct value.This may be a value node (e.g. a leaf) or object node or a list node (e.g. a branch with value). The application can invoke methods such as as(Class)on nodes that have value.- Returns:
- trueif the node has direct value,- falseotherwise.
 
- 
asDeprecated, for removal: This API element is subject to removal in a future version.Typed value as aConfigValue.- Type Parameters:
- T- type
- Parameters:
- type- type class
- Returns:
- typed value
- See Also:
 
- 
mapDeprecated, for removal: This API element is subject to removal in a future version.Typed value as aConfigValuecreated from factory method. To convert from String, you can useconfig.asString().as(Function).- Type Parameters:
- T- type
- Parameters:
- mapper- method to create an instance from config
- Returns:
- typed value
 
- 
asListDeprecated, for removal: This API element is subject to removal in a future version.Returns list of specified type.- Type Parameters:
- T- type of list elements
- Parameters:
- type- type class
- Returns:
- a typed list with values
- Throws:
- ConfigException- in case of problem to map property value.
 
- 
mapListDeprecated, for removal: This API element is subject to removal in a future version.Returns this node as a list mapping each list value using the provided mapper.- Type Parameters:
- T- type of list elements
- Parameters:
- mapper- mapper to convert each list node into a typed value
- Returns:
- a typed list with values
- Throws:
- ConfigException- in case the mapper fails to map the values
 
- 
asNodeListDeprecated, for removal: This API element is subject to removal in a future version.Returns a list of childConfignodes if the node isType#OBJECT. Returns a list of element nodes if the node isType#LIST. ThrowsMissingValueExceptionif the node isType#MISSING. Otherwise, if node isType#VALUE, it throwsConfigMappingException.- Type Parameters:
- C- the common config derived type
- Returns:
- a list of Type#OBJECTmembers or a list ofType#LISTmembers
- Throws:
- ConfigException- in case the node is- Type#VALUE
 
- 
asMapDeprecated, for removal: This API element is subject to removal in a future version.Transform all leaf nodes (values) into Map instance.- Returns:
- new Map instance that contains all config leaf node values
- Throws:
- ConfigException- in case the node is Type#MISSING.
 
- 
asNodeDeprecated, for removal: This API element is subject to removal in a future version.Returns existing current config node asConfigValue.- Returns:
- current config node as ConfigValue
 
- 
asStringDeprecated, for removal: This API element is subject to removal in a future version.String typed value.- Returns:
- typed value
 
- 
asBooleanDeprecated, for removal: This API element is subject to removal in a future version.Boolean typed value.- Returns:
- typed value
 
- 
asIntDeprecated, for removal: This API element is subject to removal in a future version.Integer typed value.- Returns:
- typed value
 
- 
asLongDeprecated, for removal: This API element is subject to removal in a future version.Long typed value.- Returns:
- typed value
 
- 
asDoubleDeprecated, for removal: This API element is subject to removal in a future version.Double typed value.- Returns:
- typed value
 
 
- 
io.helidon.config.Configinstead