public interface YamlMapping extends YamlCollection
UNNAMED_NODE
Modifier and Type | Method and Description |
---|---|
YamlNode |
child(String name)
Gets a child node by its name
|
YamlMapping |
childAsMapping(String name)
Gets a child mapping node by its name
|
YamlScalar |
childAsScalar(String name)
Gets a child scalar node by its name
|
<T> T |
childAsScalarValue(String name)
Gets a child scalar node's value by its name
See
YamlScalar for the possible types
Please note that if the scalar's type is not the expected type T,
a ClassCastException is thrown at the call site. |
<T> T |
childAsScalarValue(String name,
Class<T> type)
Gets a child scalar node's value by its name with type hinting
See
YamlScalar for the possible types |
YamlSequence |
childAsSequence(String name)
Gets a child sequence node by its name
|
Iterable<YamlNameNodePair> |
childrenPairs()
Returns the children as
YamlNameNodePair s
This method may have null values as the childNode
in the returned pairs if the node's values is explicitly defined
as !!null in the YAML document. |
childCount, children
YamlNode child(String name)
name
- the name of the child nodenull
otherwiseIterable<YamlNameNodePair> childrenPairs()
YamlNameNodePair
s
This method may have null
values as the childNode
in the returned pairs if the node's values is explicitly defined
as !!null
in the YAML document.
The difference from the YamlCollection.children()
children method is
that YamlCollection.children()
does not return null
children
nodes, while childrenPairs()
does.Iterable
pair of node names and node instancesYamlMapping childAsMapping(String name)
name
- the name of the child nodenull
otherwiseYamlSequence childAsSequence(String name)
name
- the name of the child nodenull
otherwiseYamlScalar childAsScalar(String name)
name
- the name of the child nodenull
otherwise<T> T childAsScalarValue(String name)
YamlScalar
for the possible types
Please note that if the scalar's type is not the expected type T,
a ClassCastException
is thrown at the call site.name
- the name of the child nodenull
otherwiseYamlScalar
,
childAsScalarValue(String, Class)
<T> T childAsScalarValue(String name, Class<T> type)
YamlScalar
for the possible typesname
- the name of the child nodetype
- the type that the scalar's value type to be validated
againstYamlException
- if the scalar's value is not a type of TYamlScalar
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.