Package com.amihaiemil.eoyaml
Interface YamlSequence
-
- All Superinterfaces:
Comparable<YamlNode>,Iterable<YamlNode>,YamlNode
- All Known Implementing Classes:
BaseYamlSequence,EmptyYamlSequence,MergedYamlSequence,StrictYamlSequence
public interface YamlSequence extends YamlNode, Iterable<YamlNode>
A Yaml sequence.- Since:
- 1.0.0
- Version:
- $Id: 68d9eef07b5e32f27e1c498d4a749161dd84534c $
- Author:
- Mihai Andronache (amihaiemil@gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default LocalDatedate(int index)Convenience method to directly read a LocalDate value from this sequence.default LocalDateTimedateTime(int index)Convenience method to directly read a LocalDateTime value from this sequence.default doubledoubleNumber(int index)Convenience method to directly read a double value from this sequence.default floatfloatNumber(int index)Convenience method to directly read a float value from this sequence.default StringfoldedBlockScalar(int index)Get the folded block scalar from the given index.default intinteger(int index)Convenience method to directly read an integer value from this sequence.default Iterator<YamlNode>iterator()Returns this YamlSequence's children Iterator.
It is equivalent to YamlSequence.values().iterator().default Collection<String>literalBlockScalar(int index)Get the literal block scalar from the given index.default longlongNumber(int index)Convenience method to directly read a long value from this sequence.default intsize()The number of Yaml elements (scalars, mappings and sequences) found in this sequence.default Stringstring(int index)Get the String from the given index.Collection<YamlNode>values()Fetch the values of this sequence.default YamlMappingyamlMapping(int index)Get the Yaml mapping from the given index.default YamlSequenceyamlSequence(int index)Get the Yaml sequence from the given index.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
values
Collection<YamlNode> values()
Fetch the values of this sequence.- Returns:
- Collection of
YamlNode
-
iterator
default Iterator<YamlNode> iterator()
Returns this YamlSequence's children Iterator.
It is equivalent to YamlSequence.values().iterator().
-
size
default int size()
The number of Yaml elements (scalars, mappings and sequences) found in this sequence.- Returns:
- Integer.
-
yamlMapping
default YamlMapping yamlMapping(int index)
Get the Yaml mapping from the given index.- Parameters:
index- Integer index.- Returns:
- Yaml mapping.
-
yamlSequence
default YamlSequence yamlSequence(int index)
Get the Yaml sequence from the given index.- Parameters:
index- Integer index.- Returns:
- Yaml sequence.
-
string
default String string(int index)
Get the String from the given index.- Parameters:
index- Integer index.- Returns:
- String.
-
foldedBlockScalar
default String foldedBlockScalar(int index)
Get the folded block scalar from the given index.- Parameters:
index- Integer index.- Returns:
- The folded block scalar as String.
-
literalBlockScalar
default Collection<String> literalBlockScalar(int index)
Get the literal block scalar from the given index.- Parameters:
index- Integer index.- Returns:
- The folded block scalar as String.
-
integer
default int integer(int index)
Convenience method to directly read an integer value from this sequence. It is equivalent to:YamlSequence sequence = ...; int value = Integer.parseInt(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found integer.
- Throws:
NumberFormatException- - if the Scalar value is not a parsable integer.
-
floatNumber
default float floatNumber(int index)
Convenience method to directly read a float value from this sequence. It is equivalent to:YamlSequence sequence = ...; float value = Float.parseFloat(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found float.
- Throws:
NumberFormatException- - if the Scalar value is not a parsable float.
-
doubleNumber
default double doubleNumber(int index)
Convenience method to directly read a double value from this sequence. It is equivalent to:YamlSequence sequence = ...; double value = Double.parseDouble(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found double.
- Throws:
NumberFormatException- - if the Scalar value is not a parsable double.
-
longNumber
default long longNumber(int index)
Convenience method to directly read a long value from this sequence. It is equivalent to:YamlSequence sequence = ...; long value = Long.parseLong(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found long.
- Throws:
NumberFormatException- - if the Scalar value is not a parsable long.
-
date
default LocalDate date(int index)
Convenience method to directly read a LocalDate value from this sequence. It is equivalent to:YamlSequence sequence = ...; LocalDate dateTime = LocalDate.parse(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found LocalDate.
- Throws:
DateTimeParseException- - if the Scalar value cannot be parsed.
-
dateTime
default LocalDateTime dateTime(int index)
Convenience method to directly read a LocalDateTime value from this sequence. It is equivalent to:YamlSequence sequence = ...; LocalDateTime dateTime = LocalDateTime.parse(sequence.string(...));- Parameters:
index- The index of the value.- Returns:
- Found LocalDateTime.
- Throws:
DateTimeParseException- - if the Scalar value cannot be parsed.
-
-