public interface YamlMapping extends YamlNode
Modifier and Type | Method and Description |
---|---|
default LocalDate |
date(String key)
Convenience method to directly read a LocalDate value
from this map.
|
default LocalDate |
date(YamlNode key)
Convenience method to directly read a LocalDate value
from this map.
|
default LocalDateTime |
dateTime(String key)
Convenience method to directly read a LocalDateTime value
from this map.
|
default LocalDateTime |
dateTime(YamlNode key)
Convenience method to directly read a LocalDateTime value
from this map.
|
default double |
doubleNumber(String key)
Convenience method to directly read a double value
from this map.
|
default double |
doubleNumber(YamlNode key)
Convenience method to directly read a double value
from this map.
|
default float |
floatNumber(String key)
Convenience method to directly read a float value
from this map.
|
default float |
floatNumber(YamlNode key)
Convenience method to directly read a float value
from this map.
|
default String |
indent(int indentation)
Indent this YamlMapping.
|
default int |
integer(String key)
Convenience method to directly read an integer value
from this map.
|
default int |
integer(YamlNode key)
Convenience method to directly read an integer value
from this map.
|
Set<YamlNode> |
keys()
Return the keys' set of this mapping.
Pay attention: the keys are ordered. |
default long |
longNumber(String key)
Convenience method to directly read a long value
from this map.
|
default long |
longNumber(YamlNode key)
Convenience method to directly read a long value
from this map.
|
String |
string(String key)
Get the String associated with the given key.
|
String |
string(YamlNode key)
Get the String associated with the given key.
|
YamlNode |
value(YamlNode key)
Get the YamlNode mapped to the specified key.
|
YamlMapping |
yamlMapping(String key)
Get the Yaml mapping associated with the given key.
|
YamlMapping |
yamlMapping(YamlNode key)
Get the Yaml mapping associated with the given key.
|
YamlSequence |
yamlSequence(String key)
Get the Yaml sequence associated with the given key.
|
YamlSequence |
yamlSequence(YamlNode key)
Get the Yaml sequence associated with the given key.
|
compareTo
YamlMapping yamlMapping(String key)
key
- String keyYamlMapping yamlMapping(YamlNode key)
key
- Yaml node (mapping or sequence) keyYamlSequence yamlSequence(String key)
key
- String keyYamlSequence yamlSequence(YamlNode key)
key
- Yaml node (mapping or sequence) keyString string(String key)
key
- String keyString string(YamlNode key)
key
- Yaml node (mapping or sequence) keyYamlNode value(YamlNode key)
key
- YamlNode key. Could be a simple scalar,
a YamlMapping or a YamlSequence.Set<YamlNode> keys()
default String indent(int indentation)
indent
in interface YamlNode
indentation
- Indentation to start with. Usually, it's 0, since we
don't want to have spaces at the beginning. But in the case of nested
YamlNodes, this value may be greater than 0.default int integer(String key)
YamlMapping map = ...; int value = Integer.parseInt(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable integer.default int integer(YamlNode key)
YamlMapping map = ...; int value = Integer.parseInt(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable integer.default float floatNumber(String key)
YamlMapping map = ...; float value = Float.parseFloat(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable float.default float floatNumber(YamlNode key)
YamlMapping map = ...; float value = Float.parseFloat(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable float.default double doubleNumber(String key)
YamlMapping map = ...; double value = Double.parseDouble(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable double.default double doubleNumber(YamlNode key)
YamlMapping map = ...; double value = Double.parseDouble(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable double.default long longNumber(String key)
YamlMapping map = ...; long value = Long.parseLong(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable long.default long longNumber(YamlNode key)
YamlMapping map = ...; long value = Long.parseLong(map.string(...));
key
- The key of the value.NumberFormatException
- - if the Scalar value
is not a parsable long.default LocalDate date(String key)
YamlMapping map = ...; LocalDate date = LocalDate.parse(map.string(...));
key
- The key of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.default LocalDate date(YamlNode key)
YamlMapping map = ...; LocalDate date = LocalDate.parse(map.string(...));
key
- The key of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.default LocalDateTime dateTime(String key)
YamlMapping map = ...; LocalDateTime dateTime = LocalDateTime.parse(map.string(...));
key
- The key of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.default LocalDateTime dateTime(YamlNode key)
YamlMapping map = ...; LocalDateTime dateTime = LocalDateTime.parse(map.string(...));
key
- The key of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.Copyright © 2020. All rights reserved.