Class YAMLConfig

java.lang.Object
net.vitacraft.serverlibraries.api.config.YAMLConfig
All Implemented Interfaces:
Config

public class YAMLConfig extends Object implements Config
  • Constructor Details

    • YAMLConfig

      public YAMLConfig(File file)
      Create a new YAMLConfig instance
      Parameters:
      file - the file to load the configuration from
  • Method Details

    • getName

      public String getName()
      Get the name of the configuration file
      Specified by:
      getName in interface Config
      Returns:
      the name of the configuration file
    • getString

      public String getString(String key)
      Get a string value from the configuration
      Specified by:
      getString in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the string value
    • getInt

      public int getInt(String key)
      Get an integer value from the configuration
      Specified by:
      getInt in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the integer value
    • getStringList

      public List<String> getStringList(String key)
      Get a list of strings from the configuration
      Specified by:
      getStringList in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the list of strings
    • getLong

      public long getLong(String key)
      Get a long value from the configuration
      Specified by:
      getLong in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the long value
    • getDouble

      public double getDouble(String key)
      Get a double value from the configuration
      Specified by:
      getDouble in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the double value
    • getBool

      public boolean getBool(String key)
      Get a boolean value from the configuration
      Specified by:
      getBool in interface Config
      Parameters:
      key - the key to get the value from
      Returns:
      the boolean value
    • setString

      public void setString(String key, String value)
      Set a string value in the configuration
      Specified by:
      setString in interface Config
      Parameters:
      key - the key to set the value to
      value - the value to set
    • setBool

      public void setBool(String key, boolean value)
      Set a boolean value in the configuration
      Specified by:
      setBool in interface Config
      Parameters:
      key - the key to set the value to
      value - the value to set
    • setInt

      public void setInt(String key, int value)
      Set an integer value in the configuration
      Specified by:
      setInt in interface Config
      Parameters:
      key - the key to set the value to
      value - the value to set
    • setLong

      public void setLong(String key, long value)
      Set a long value in the configuration
      Specified by:
      setLong in interface Config
      Parameters:
      key - the key to set the value to
      value - the value to set
    • setDouble

      public void setDouble(String key, double value)
      Set a double value in the configuration
      Specified by:
      setDouble in interface Config
      Parameters:
      key - the key to set the value to
      value - the value to set