public interface YamlSequence extends YamlNode, Iterable<YamlNode>
Modifier and Type | Method and Description |
---|---|
default LocalDate |
date(int index)
Convenience method to directly read a LocalDate value
from this sequence.
|
default LocalDateTime |
dateTime(int index)
Convenience method to directly read a LocalDateTime value
from this sequence.
|
default double |
doubleNumber(int index)
Convenience method to directly read a double value
from this sequence.
|
default float |
floatNumber(int index)
Convenience method to directly read a float value
from this sequence.
|
default String |
indent(int indentation)
Indent this YamlSequence.
|
default int |
integer(int index)
Convenience method to directly read an integer value
from this sequence.
|
Iterator<YamlNode> |
iterator()
Returns this YamlSequence's children Iterator.
It is equivalent to YamlSequence.values().iterator(). |
default long |
longNumber(int index)
Convenience method to directly read a long value
from this sequence.
|
int |
size()
The number of Yaml elements (scalars, mappings and sequences) found in
this sequence.
|
String |
string(int index)
Get the String from the given index.
|
YamlMapping |
yamlMapping(int index)
Get the Yaml mapping from the given index.
|
YamlSequence |
yamlSequence(int index)
Get the Yaml sequence from the given index.
|
compareTo
forEach, spliterator
int size()
YamlMapping yamlMapping(int index)
index
- Integer index.YamlSequence yamlSequence(int index)
index
- Integer index.String string(int index)
index
- Integer index.Iterator<YamlNode> iterator()
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(int index)
YamlSequence sequence = ...; int value = Integer.parseInt(sequence.string(...));
index
- The index of the value.NumberFormatException
- - if the Scalar value
is not a parsable integer.default float floatNumber(int index)
YamlSequence sequence = ...; float value = Float.parseFloat(sequence.string(...));
index
- The index of the value.NumberFormatException
- - if the Scalar value
is not a parsable float.default double doubleNumber(int index)
YamlSequence sequence = ...; double value = Double.parseDouble(sequence.string(...));
index
- The index of the value.NumberFormatException
- - if the Scalar value
is not a parsable double.default long longNumber(int index)
YamlSequence sequence = ...; long value = Long.parseLong(sequence.string(...));
index
- The index of the value.NumberFormatException
- - if the Scalar value
is not a parsable long.default LocalDate date(int index)
YamlSequence sequence = ...; LocalDate dateTime = LocalDate.parse(sequence.string(...));
index
- The index of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.default LocalDateTime dateTime(int index)
YamlSequence sequence = ...; LocalDateTime dateTime = LocalDateTime.parse(sequence.string(...));
index
- The index of the value.DateTimeParseException
- - if the Scalar value cannot be parsed.Copyright © 2020. All rights reserved.