- java.lang.Object
-
- io.helidon.config.ValueNodeImpl
-
- All Implemented Interfaces:
MergeableNode
,ConfigNode
,ConfigNode.ValueNode
public class ValueNodeImpl extends Object implements ConfigNode.ValueNode, MergeableNode
ImplementsConfigNode.ValueNode
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.config.spi.ConfigNode
ConfigNode.ListNode, ConfigNode.NodeType, ConfigNode.ObjectNode, ConfigNode.ValueNode
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ValueNodeImpl(String value)
Initialize node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValueNodeImpl
create(String value)
Create a value node for the provided value.String
description()
Description of this node.boolean
equals(Object o)
String
get()
Get the value of this value node.int
hashCode()
boolean
hasValue()
Each node may have a direct value, and in addition may be an object node or a list node.ValueNodeImpl
initDescription(String description)
Initialize diagnostics description of source of node instance.MergeableNode
merge(MergeableNode node)
Returns new instance mergeable node of same type of original one that merges also with specified node.String
toString()
Optional<String>
value()
Get the direct value of this config node.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigNode.ValueNode
nodeType
-
-
-
-
Constructor Detail
-
ValueNodeImpl
protected ValueNodeImpl(String value)
Initialize node.- Parameters:
value
- node value
-
-
Method Detail
-
value
public Optional<String> value()
Description copied from interface:ConfigNode
Get the direct value of this config node. Any node type can have a direct value.- Specified by:
value
in interfaceConfigNode
- Returns:
- a value if present,
empty
otherwise
-
get
public String get()
Description copied from interface:ConfigNode.ValueNode
Get the value of this value node.- Specified by:
get
in interfaceConfigNode.ValueNode
- Returns:
- string with the node value
-
create
public static ValueNodeImpl create(String value)
Create a value node for the provided value.- Parameters:
value
- value of this node- Returns:
- value node for the value
-
merge
public MergeableNode merge(MergeableNode node)
Description copied from interface:MergeableNode
Returns new instance mergeable node of same type of original one that merges also with specified node.- Specified by:
merge
in interfaceMergeableNode
- Parameters:
node
- node to be used to merge with- Returns:
- new instance of mergeable node that combines original node with specified one
-
initDescription
public ValueNodeImpl 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:
- description of the node.
-
hasValue
public boolean hasValue()
Description copied from interface:MergeableNode
Each 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:
hasValue
in interfaceMergeableNode
- Returns:
- true if this node contains a value
-
-