Interface YamlMapping

    • Method Detail

      • keys

        Set<YamlNode> keys()
        Return the keys' set of this mapping.

        Returns:
        Set of YamlNode keys.
      • value

        YamlNode value​(YamlNode key)
        Get the YamlNode mapped to the specified key.
        Parameters:
        key - YamlNode key. Could be a simple scalar, a YamlMapping or a YamlSequence.
        Returns:
        The found YamlNode or null if nothing is found.
      • yamlMapping

        default YamlMapping yamlMapping​(String key)
        Get the Yaml mapping associated with the given key.
        Parameters:
        key - String key
        Returns:
        Yaml mapping or null if the key is missing, or not pointing to a mapping.
      • yamlMapping

        default YamlMapping yamlMapping​(YamlNode key)
        Get the Yaml mapping associated with the given key.
        Parameters:
        key - Yaml node (mapping or sequence) key
        Returns:
        Yaml mapping or null if the key is missing, or not pointing to a mapping.
      • yamlSequence

        default YamlSequence yamlSequence​(String key)
        Get the Yaml sequence associated with the given key.
        Parameters:
        key - String key
        Returns:
        Yaml sequence or null if the key is missing, or not pointing to a sequence.
      • yamlSequence

        default YamlSequence yamlSequence​(YamlNode key)
        Get the Yaml sequence associated with the given key.
        Parameters:
        key - Yaml node (mapping or sequence) key
        Returns:
        Yaml sequence or null if the key is missing, or not pointing to a sequence
      • string

        default String string​(String key)
        Get the String associated with the given key.
        Parameters:
        key - String key
        Returns:
        String or null if the key is missing, or not pointing to a scalar.
      • string

        default String string​(YamlNode key)
        Get the String associated with the given key.
        Parameters:
        key - Yaml node key
        Returns:
        String or null if the key is missing, or not pointing to a scalar.
      • foldedBlockScalar

        default String foldedBlockScalar​(String key)
        Get the String folded block scalar associated with the given key.
        Parameters:
        key - String key
        Returns:
        String or null if the key is missing, or not pointing to a folded block scalar.
      • foldedBlockScalar

        default String foldedBlockScalar​(YamlNode key)
        Get the String folded block scalar associated with the given key.
        Parameters:
        key - Yaml node key.
        Returns:
        String or null if the key is missing, or not pointing to a folded block scalar.
      • literalBlockScalar

        default Collection<String> literalBlockScalar​(String key)
        Get the String lines of the literal block scalar associated with the given key.
        Parameters:
        key - String key
        Returns:
        Collection of String or null if the key is missing, or not pointing to a literal block scalar.
      • literalBlockScalar

        default Collection<String> literalBlockScalar​(YamlNode key)
        Get the String lines of the literal block scalar associated with the given key.
        Parameters:
        key - String key
        Returns:
        Collection of String or null if the key is missing, or not pointing to a literal block scalar.
      • value

        default YamlNode value​(String key)
        Get the YamlNode mapped to the specified key.
        Parameters:
        key - String key.
        Returns:
        The found YamlNode or null if nothing is found.
      • integer

        default int integer​(String key)
        Convenience method to directly read an integer value from this map. It is equivalent to:
             YamlMapping map = ...;
             int value = Integer.parseInt(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found integer or -1 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable integer.
      • integer

        default int integer​(YamlNode key)
        Convenience method to directly read an integer value from this map. It is equivalent to:
             YamlMapping map = ...;
             int value = Integer.parseInt(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found integer or -1 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable integer.
      • floatNumber

        default float floatNumber​(String key)
        Convenience method to directly read a float value from this map. It is equivalent to:
             YamlMapping map = ...;
             float value = Float.parseFloat(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found float or -1 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable float.
      • floatNumber

        default float floatNumber​(YamlNode key)
        Convenience method to directly read a float value from this map. It is equivalent to:
             YamlMapping map = ...;
             float value = Float.parseFloat(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found float or -1 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable float.
      • doubleNumber

        default double doubleNumber​(String key)
        Convenience method to directly read a double value from this map. It is equivalent to:
             YamlMapping map = ...;
             double value = Double.parseDouble(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found double or -1.0 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable double.
      • doubleNumber

        default double doubleNumber​(YamlNode key)
        Convenience method to directly read a double value from this map. It is equivalent to:
             YamlMapping map = ...;
             double value = Double.parseDouble(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found double or -1.0 if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable double.
      • longNumber

        default long longNumber​(String key)
        Convenience method to directly read a long value from this map. It is equivalent to:
             YamlMapping map = ...;
             long value = Long.parseLong(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found long or -1L if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable long.
      • longNumber

        default long longNumber​(YamlNode key)
        Convenience method to directly read a long value from this map. It is equivalent to:
             YamlMapping map = ...;
             long value = Long.parseLong(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found long or -1L if there is no value for the key, or the value is not a Scalar.
        Throws:
        NumberFormatException - - if the Scalar value is not a parsable long.
      • date

        default LocalDate date​(String key)
        Convenience method to directly read a LocalDate value from this map. It is equivalent to:
             YamlMapping map = ...;
             LocalDate date = LocalDate.parse(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found LocalDate or null if there is no value for the key, or the value is not a Scalar.
        Throws:
        DateTimeParseException - - if the Scalar value cannot be parsed.
      • date

        default LocalDate date​(YamlNode key)
        Convenience method to directly read a LocalDate value from this map. It is equivalent to:
             YamlMapping map = ...;
             LocalDate date = LocalDate.parse(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found LocalDate or null if there is no value for the key, or the value is not a Scalar.
        Throws:
        DateTimeParseException - - if the Scalar value cannot be parsed.
      • dateTime

        default LocalDateTime dateTime​(String key)
        Convenience method to directly read a LocalDateTime value from this map. It is equivalent to:
             YamlMapping map = ...;
             LocalDateTime dateTime = LocalDateTime.parse(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found LocalDateTime or null if there is no value for the key, or the value is not a Scalar.
        Throws:
        DateTimeParseException - - if the Scalar value cannot be parsed.
      • dateTime

        default LocalDateTime dateTime​(YamlNode key)
        Convenience method to directly read a LocalDateTime value from this map. It is equivalent to:
             YamlMapping map = ...;
             LocalDateTime dateTime = LocalDateTime.parse(map.string(...));
         
        Parameters:
        key - The key of the value.
        Returns:
        Found LocalDateTime or null if there is no value for the key, or the value is not a Scalar.
        Throws:
        DateTimeParseException - - if the Scalar value cannot be parsed.