- java.lang.Object
-
- io.helidon.config.AbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder>
-
- io.helidon.config.ObjectNodeBuilderImpl
-
- All Implemented Interfaces:
ConfigNode.ObjectNode.Builder
public class ObjectNodeBuilderImpl extends AbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder> implements ConfigNode.ObjectNode.Builder
Implementation ofConfigNode.ObjectNode.Builder
. This class ispublic
for the time being, though it should not be.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.helidon.config.AbstractNodeBuilderImpl
AbstractNodeBuilderImpl.MergingKey
-
-
Constructor Summary
Constructors Constructor Description ObjectNodeBuilderImpl(Function<String,String> tokenResolver)
Initialize object builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigNode.ObjectNode.Builder
addList(String key, ConfigNode.ListNode list)
Sets List node associated with specifiedkey
.ObjectNodeBuilderImpl
addNode(String name, ConfigNode node)
Sets new member into the map.ConfigNode.ObjectNode.Builder
addObject(String key, ConfigNode.ObjectNode object)
Sets Object node associated with specifiedkey
.ConfigNode.ObjectNode.Builder
addValue(String key, ConfigNode.ValueNode value)
Sets String value associated with specifiedkey
.ObjectNodeImpl
build()
Build new instance ofConfigNode.ObjectNode
.static ObjectNodeBuilderImpl
create()
Create a new builder instance.static ObjectNodeBuilderImpl
create(Map<String,ConfigNode> members)
Creates new instance of the builder initialized from original map of members.static ObjectNodeBuilderImpl
create(Map<String,ConfigNode> members, Function<String,String> resolveTokenFunction)
Creates new instance of the builder initialized from original map of members.protected String
id(AbstractNodeBuilderImpl.MergingKey key)
Returns id computed from key.protected MergeableNode
member(String name)
Returns member instance associated with specified id.protected void
merge(String name, MergeableNode node)
Merges a member of specified id with specified node.String
toString()
protected void
update(String name, MergeableNode node)
Updates/replaces a member of specified id by specified node.ObjectNodeBuilderImpl
value(String value)
Configure direct value of this node.-
Methods inherited from class io.helidon.config.AbstractNodeBuilderImpl
deepMerge
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigNode.ObjectNode.Builder
addValue
-
-
-
-
Method Detail
-
create
public static ObjectNodeBuilderImpl create()
Create a new builder instance.- Returns:
- a new builder
-
create
public static ObjectNodeBuilderImpl create(Map<String,ConfigNode> members)
Creates new instance of the builder initialized from original map of members.- Parameters:
members
- initial members- Returns:
- new builder instance
-
create
public static ObjectNodeBuilderImpl create(Map<String,ConfigNode> members, Function<String,String> resolveTokenFunction)
Creates new instance of the builder initialized from original map of members.- Parameters:
members
- initial membersresolveTokenFunction
- a function resolving key token- Returns:
- new builder instance
-
addNode
public ObjectNodeBuilderImpl addNode(String name, ConfigNode node)
Sets new member into the map.- Specified by:
addNode
in interfaceConfigNode.ObjectNode.Builder
- Parameters:
name
- node namenode
- new node- Returns:
- modified builder
-
id
protected String id(AbstractNodeBuilderImpl.MergingKey key)
Description copied from class:AbstractNodeBuilderImpl
Returns id computed from key.- Specified by:
id
in classAbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder>
- Parameters:
key
- key to be used to extract id from- Returns:
- id computed from key
-
member
protected MergeableNode member(String name)
Description copied from class:AbstractNodeBuilderImpl
Returns member instance associated with specified id.- Specified by:
member
in classAbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder>
- Parameters:
name
- member id- Returns:
- member instance associated with specified id.
-
update
protected void update(String name, MergeableNode node)
Description copied from class:AbstractNodeBuilderImpl
Updates/replaces a member of specified id by specified node.- Specified by:
update
in classAbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder>
- Parameters:
name
- member idnode
- new node
-
merge
protected void merge(String name, MergeableNode node)
Description copied from class:AbstractNodeBuilderImpl
Merges a member of specified id with specified node.- Specified by:
merge
in classAbstractNodeBuilderImpl<String,ConfigNode.ObjectNode.Builder>
- Parameters:
name
- member idnode
- new node
-
value
public ObjectNodeBuilderImpl value(String value)
Configure direct value of this node.- Specified by:
value
in interfaceConfigNode.ObjectNode.Builder
- Parameters:
value
- the value- Returns:
- modified builder
-
addValue
public ConfigNode.ObjectNode.Builder addValue(String key, ConfigNode.ValueNode value)
Description copied from interface:ConfigNode.ObjectNode.Builder
Sets String value associated with specifiedkey
.- Specified by:
addValue
in interfaceConfigNode.ObjectNode.Builder
- Parameters:
key
- member keyvalue
- string value- Returns:
- modified builder
-
addObject
public ConfigNode.ObjectNode.Builder addObject(String key, ConfigNode.ObjectNode object)
Description copied from interface:ConfigNode.ObjectNode.Builder
Sets Object node associated with specifiedkey
.- Specified by:
addObject
in interfaceConfigNode.ObjectNode.Builder
- Parameters:
key
- member keyobject
- object node- Returns:
- modified builder
-
addList
public ConfigNode.ObjectNode.Builder addList(String key, ConfigNode.ListNode list)
Description copied from interface:ConfigNode.ObjectNode.Builder
Sets List node associated with specifiedkey
.- Specified by:
addList
in interfaceConfigNode.ObjectNode.Builder
- Parameters:
key
- member keylist
- list node- Returns:
- modified builder
-
build
public ObjectNodeImpl build()
Description copied from interface:ConfigNode.ObjectNode.Builder
Build new instance ofConfigNode.ObjectNode
.- Specified by:
build
in interfaceConfigNode.ObjectNode.Builder
- Returns:
- new instance of
ConfigNode.ObjectNode
.
-
-