Interface ScopedConfigurationNode<N extends ScopedConfigurationNode<N>>
- Type Parameters:
- N- self type
- All Superinterfaces:
- ConfigurationNode
- All Known Subinterfaces:
- AttributedConfigurationNode,- BasicConfigurationNode,- CommentedConfigurationNode,- CommentedConfigurationNodeIntermediary<N>
Any methods that return ConfigurationNode in
 ConfigurationNode should be overridden to return the N
 self-type instead.
- Since:
- 4.0.0
- 
Field SummaryFields inherited from interface org.spongepowered.configurate.ConfigurationNodeNUMBER_DEF
- 
Method SummaryModifier and TypeMethodDescriptionact(CheckedConsumer<? super N, E> action) Execute an action on this node.Gets a new child node created as the next entry in the list.Gets the "list children" attached to this node, if it has any.Gets the "map children" attached to this node, if it has any.copy()Creates a deep copy of this node.from(ConfigurationNode other) Apply all data fromotherto this node, overwriting any existing data.<V> Nhint(RepresentationHint<V> hint, @Nullable V value) Set a representation hint on this node.mergeFrom(ConfigurationNode other) Set all the values from the given node that are not present in this node to their values in the provided node.Gets the node at the given (relative) path, possibly traversing multiple levels of nodes.Gets the node at the given (relative) path, possibly traversing multiple levels of nodes.@Nullable Nparent()Gets the parent of this node.Set the raw value of this node.self()Get a correctly typed instance of this node.Set this node's value to the given value.default <V> Nset(io.leangen.geantyref.TypeToken<V> type, @Nullable V value) Set this node's value to the given value.default <V> NSet this node's value to the given value.default Nset(AnnotatedType type, @Nullable Object value) Set this node's value to the given value.default NSet this node's value to the given value.default <V> NSet the node's value to the provided list.default <V> NSet the node's value to the provided list.toListCollector(io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to this node as list children.toListCollector(Class<V> valueType) Create a collector that appends values to this node as list children.toMapCollector(io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to this node as map children.toMapCollector(Class<V> valueType) Create a collector that appends values to this node as map children.Methods inherited from interface org.spongepowered.configurate.ConfigurationNodeempty, get, get, get, get, get, get, get, get, get, get, get, get, getBoolean, getBoolean, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getList, getList, getList, getList, getList, getList, getLong, getLong, getString, getString, hasChild, hasChild, hint, isList, isMap, isNull, key, options, ownHint, ownHints, path, raw, rawScalar, removeChild, require, require, require, virtual, visit, visit, visit, visit
- 
Method Details- 
selfGet a correctly typed instance of this node.- Returns:
- the node type
- Since:
- 4.0.0
 
- 
appendListNodeGets a new child node created as the next entry in the list.- Specified by:
- appendListNodein interface- ConfigurationNode
- Returns:
- a new child created as the next entry in the list when it is attached
 
- 
copyCreates a deep copy of this node.If this node has child nodes (is a list or map), the child nodes will also be copied. This action is performed recursively. The resultant node will (initially) contain the same value(s) as this node, and will therefore be equal, however, changes made to the original will not be reflected in the copy, and vice versa.The actual scalar values that back the configuration will not be copied - only the node structure that forms the configuration. This is not a problem in most cases, as the scalar values stored in configurations are usually immutable. (e.g. strings, numbers, booleans). - Specified by:
- copyin interface- ConfigurationNode
- Returns:
- a copy of this node
 
- 
nodeGets the node at the given (relative) path, possibly traversing multiple levels of nodes.This is the main method used to navigate through the configuration. The path parameter effectively consumes an array of keys, which locate the unique position of a given node within the structure. Each element will navigate one level down in the configuration hierarchy A node is always returned by this method. If the given node does not exist in the structure, a virtualnode will be returned which represents the position.- Specified by:
- nodein interface- ConfigurationNode
- Parameters:
- path- the path to fetch the node at
- Returns:
- the node at the given path, possibly virtual
 
- 
nodeGets the node at the given (relative) path, possibly traversing multiple levels of nodes.This is the main method used to navigate through the configuration. The path parameter effectively consumes an array of keys, which locate the unique position of a given node within the structure. A node is always returned by this method. If the given node does not exist in the structure, a virtualnode will be returned which represents the position.- Specified by:
- nodein interface- ConfigurationNode
- Parameters:
- path- the path to fetch the node at
- Returns:
- the node at the given path, possibly virtual
 
- 
parentGets the parent of this node.If this node is currently virtual, this method's result may be inaccurate.- Specified by:
- parentin interface- ConfigurationNode
- Returns:
- the nodes parent
 
- 
fromApply all data fromotherto this node, overwriting any existing data.- Specified by:
- fromin interface- ConfigurationNode
- Parameters:
- other- source node
- Returns:
- this node
 
- 
mergeFromSet all the values from the given node that are not present in this node to their values in the provided node.Map keys will be merged. Lists and scalar values will be replaced. - Specified by:
- mergeFromin interface- ConfigurationNode
- Parameters:
- other- the node to merge values from
- Returns:
- this node
 
- 
setSet this node's value to the given value.The value type will be taken from the provided value's class and used to determine a serializer. To set a value of a parameterized type, the parameters must be explicitly specified. - Specified by:
- setin interface- ConfigurationNode
- Parameters:
- value- the value to set
- Returns:
- this node
- Throws:
- SerializationException
 
- 
setSet this node's value to the given value.If the provided value is a Collectionor aMap, it will be unwrapped into the appropriate configuration node structure.This method will also perform serialization using the appropriate TypeSerializerfor the given type, or casting if no type serializer is found.This method will fail if a raw type (i.e. a parameterized type without its type parameters) is passed. Because this method accepts a non-parameterized Typeparameter, it has no compile-time type checking. The variants that takeTypeTokenandConfigurationNode.set(Class, Object)should be preferred where possible.- Specified by:
- setin interface- ConfigurationNode
- Parameters:
- type- the type to use for serialization type information
- value- the value to set
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type. No change will be made to the node.
 
- 
setSet this node's value to the given value.If the provided value is a Collectionor aMap, it will be unwrapped into the appropriate configuration node structure.This method will also perform serialization using the appropriate TypeSerializerfor the given type, or casting if no type serializer is found.This method will fail if a raw type (i.e. a parameterized type without its type parameters) is passed. Because this method accepts a non-parameterized Typeparameter, it has no compile-time type checking. The variants that takeTypeTokenandConfigurationNode.set(Class, Object)should be preferred where possible.- Specified by:
- setin interface- ConfigurationNode
- Parameters:
- type- the annotated type to use for serialization type information
- value- the value to set
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type. No change will be made to the node.
 
- 
setDescription copied from interface:ConfigurationNodeSet this node's value to the given value.If the provided value is a Collectionor aMap, it will be unwrapped into the appropriate configuration node structure.This method will also perform serialization using the appropriate TypeSerializerfor the given type, or casting if no type serializer is found.This method will fail if a raw type (i.e. a parameterized type without its type parameters) is passed. - Specified by:
- setin interface- ConfigurationNode
- Type Parameters:
- V- the type to serialize to
- Parameters:
- type- the type to use for serialization type information
- value- the value to set
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type. No change will be made to the node.
 
- 
setdefault <V> N set(io.leangen.geantyref.TypeToken<V> type, @Nullable V value) throws SerializationException Description copied from interface:ConfigurationNodeSet this node's value to the given value.If the provided value is a Collectionor aMap, it will be unwrapped into the appropriate configuration node structure.This method will also perform serialization using the appropriate TypeSerializerfor the given type, or casting if no type serializer is found.- Specified by:
- setin interface- ConfigurationNode
- Type Parameters:
- V- the type to serialize to
- Parameters:
- type- the type to use for serialization type information
- value- the value to set
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type. No change will be made to the node.
 
- 
setListDescription copied from interface:ConfigurationNodeSet the node's value to the provided list.This method provides a helper for constructing the appropriate Typefor serializing aList- Specified by:
- setListin interface- ConfigurationNode
- Type Parameters:
- V- list element type, the- Tin- List<T>
- Parameters:
- elementType- the type of the list elements. This must not be a raw type.
- items- the list to serializer
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type.
- See Also:
 
- 
setListdefault <V> N setList(io.leangen.geantyref.TypeToken<V> elementType, @Nullable List<V> items) throws SerializationException Description copied from interface:ConfigurationNodeSet the node's value to the provided list.This method provides a helper for constructing the appropriate Typefor serializing aList- Specified by:
- setListin interface- ConfigurationNode
- Type Parameters:
- V- list element type, the- Tin- List<T>
- Parameters:
- elementType- the type of the list elements. This must not be a raw type.
- items- the list to serializer
- Returns:
- this node
- Throws:
- SerializationException- if the value fails to be converted to the requested type.
- See Also:
 
- 
rawSet the raw value of this node.The provided value must be of a type accepted by ConfigurationOptions.acceptsType(Class). No other serialization will be performed.- Specified by:
- rawin interface- ConfigurationNode
- Parameters:
- value- the value to set on this node
- Returns:
- this node
 
- 
childrenListList<N> childrenList()Gets the "list children" attached to this node, if it has any.If this node does not have list children, an empty list is returned.- Specified by:
- childrenListin interface- ConfigurationNode
- Returns:
- the list children currently attached to this node
 
- 
childrenMapMap<Object,N> childrenMap()Gets the "map children" attached to this node, if it has any.If this node does not have map children, an empty map returned.- Specified by:
- childrenMapin interface- ConfigurationNode
- Returns:
- the map children currently attached to this node
 
- 
toMapCollectordefault <V> Collector<Map.Entry<?,V>, toMapCollectorN, N> (io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to this node as map children.This collector does not accept values in parallel. - Specified by:
- toMapCollectorin interface- ConfigurationNode
- Type Parameters:
- V- value type
- Parameters:
- valueType- marker for value type
- Returns:
- a new collector
 
- 
toMapCollectorCreate a collector that appends values to this node as map children.This collector does not accept values in parallel. - Specified by:
- toMapCollectorin interface- ConfigurationNode
- Type Parameters:
- V- value type
- Parameters:
- valueType- marker for value type
- Returns:
- a new collector
 
- 
toListCollectorCreate a collector that appends values to this node as list children.This collector does not accept values in parallel. - Specified by:
- toListCollectorin interface- ConfigurationNode
- Type Parameters:
- V- value type
- Parameters:
- valueType- marker for value type
- Returns:
- a new collector
 
- 
toListCollectorCreate a collector that appends values to this node as list children.This collector does not accept values in parallel. - Specified by:
- toListCollectorin interface- ConfigurationNode
- Type Parameters:
- V- value type
- Parameters:
- valueType- marker for value type
- Returns:
- a new collector
 
- 
actExecute an action on this node. This allows performing multiple operations on a single node without having to clutter up the surrounding scope.- Type Parameters:
- E- thrown type
- Parameters:
- action- the action to perform on this node
- Returns:
- this node
- Throws:
- E- when thrown by callback- action
- Since:
- 4.0.0
 
- 
hintDescription copied from interface:ConfigurationNodeSet a representation hint on this node.Removing a hint from this node means the hint's value will be delegated to the node's parent. To explicitly revert to a hint's default, apply that default value. - Specified by:
- hintin interface- ConfigurationNode
- Type Parameters:
- V- hint value type
- Parameters:
- hint- the hint to set a value for
- value- value to set, or null to unset for self
- Returns:
- this node
 
 
-