- java.lang.Object
-
- java.util.AbstractMap<String,ConfigNode>
-
- io.helidon.config.ObjectNodeImpl
-
- All Implemented Interfaces:
MergeableNode,ConfigNode,ConfigNode.ObjectNode,Map<String,ConfigNode>
public class ObjectNodeImpl extends AbstractMap<String,ConfigNode> implements ConfigNode.ObjectNode, MergeableNode
ImplementsConfigNode.ObjectNode.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
Nested classes/interfaces inherited from interface io.helidon.config.spi.ConfigNode
ConfigNode.ListNode, ConfigNode.NodeType, ConfigNode.ObjectNode, ConfigNode.ValueNode
-
Nested classes/interfaces inherited from interface io.helidon.config.spi.ConfigNode.ObjectNode
ConfigNode.ObjectNode.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescription()Description of this node.Set<Map.Entry<String,ConfigNode>>entrySet()booleanhasValue()Each node may have a direct value, and in addition may be an object node or a list node.ObjectNodeImplinitDescription(String description)Initialize diagnostics description of source of node instance.MergeableNodemerge(MergeableNode node)Returns new instance mergeable node of same type of original one that merges also with specified node.StringtoString()Optional<String>value()Get the direct value of this config node.static ObjectNodeImplwrap(ConfigNode.ObjectNode objectNode)Wraps value node into mergeable value node.static ObjectNodeImplwrap(ConfigNode.ObjectNode objectNode, Function<String,String> resolveTokenFunction)Wraps value node into mergeable value node.-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigNode.ObjectNode
nodeType
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
wrap
public static ObjectNodeImpl wrap(ConfigNode.ObjectNode objectNode)
Wraps value node into mergeable value node.- Parameters:
objectNode- original node- Returns:
- new instance of mergeable node or original node if already was mergeable.
-
wrap
public static ObjectNodeImpl wrap(ConfigNode.ObjectNode objectNode, Function<String,String> resolveTokenFunction)
Wraps value node into mergeable value node.- Parameters:
objectNode- original noderesolveTokenFunction- a token resolver- Returns:
- new instance of mergeable node or original node if already was mergeable.
-
entrySet
public Set<Map.Entry<String,ConfigNode>> entrySet()
- Specified by:
entrySetin interfaceMap<String,ConfigNode>- Specified by:
entrySetin classAbstractMap<String,ConfigNode>
-
merge
public MergeableNode merge(MergeableNode node)
Description copied from interface:MergeableNodeReturns new instance mergeable node of same type of original one that merges also with specified node.- Specified by:
mergein interfaceMergeableNode- Parameters:
node- node to be used to merge with- Returns:
- new instance of mergeable node that combines original node with specified one
-
toString
public String toString()
- Overrides:
toStringin classAbstractMap<String,ConfigNode>
-
initDescription
public ObjectNodeImpl initDescription(String description)
Initialize diagnostics description of source of node instance.- Parameters:
description- diagnostics description- Returns:
- this instance
-
description
public String description()
Description of this node.- Returns:
- node description
-
hasValue
public boolean hasValue()
Description copied from interface:MergeableNodeEach node may have a direct value, and in addition may be an object node or a list node. This method returns true for any node with direct value.- Specified by:
hasValuein interfaceMergeableNode- Returns:
- true if this node contains a value
-
value
public Optional<String> value()
Description copied from interface:ConfigNodeGet the direct value of this config node. Any node type can have a direct value.- Specified by:
valuein interfaceConfigNode- Returns:
- a value if present,
emptyotherwise
-
-