Interface YamlSequence

    • Method Detail

      • iterator

        default Iterator<YamlNode> iterator()
        Returns this YamlSequence's children Iterator.

        It is equivalent to YamlSequence.values().iterator().
        Specified by:
        iterator in interface Iterable<YamlNode>
        Returns:
        Iterator of YamlNode.
      • 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.