Class YamlConfig


  • public class YamlConfig
    extends Object
    • Method Detail

      • load

        public static YamlConfig load​(Reader reader)
        Create configuration from Reader
        Parameters:
        reader - the reader to read config from
        Returns:
        YamlConfig instance
      • load

        public static YamlConfig load​(InputStream in)
        Create configuration from input stream
        Parameters:
        in - the Input stream to read from
        Returns:
        YamlConfig instance
      • load

        public static YamlConfig load​(org.yaml.snakeyaml.Yaml yaml,
                                      InputStream in)
        Create configuration from input stream, using your yaml instance
        Parameters:
        yaml - the Yaml instance to use
        in - the Input stream to read from
        Returns:
        YamlConfig instance
      • getString

        public String getString​(String key)
        Gets the String value for the specified key from the config.
        Parameters:
        key - Key in dotted notation like first.second[2].third
        Returns:
        The String value of property.
        null if the key is not present or not a leaf node. Boolean or Integer or other format are converted to String.
      • getInt

        public Integer getInt​(String key)
        Gets the Integer value for the specified key from the config.
        Parameters:
        key - Key in dotted notation like first.second[2].third
        Returns:
        The Integer value of property.
        null if the key is not present or not a leaf node.