Interface IConfigurationAdapter

All Known Implementing Classes:
BungeeConfigAdapter, SpigotConfigAdapter

public interface IConfigurationAdapter
ConfigurationAdapter interface which handles differences between BungeeCord and Spigot in configuration structure.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    getBoolean(String path, boolean def)
    Returns the boolean value from the configuration.
    int
    getInt(String path, int def)
    Returns the int value from the configuration.
    getString(String path, String def)
    Returns the String value from the configuration.
    Returns the list of Strings from the configuration.
    boolean
    Checks if the configuration is setup
    void
    Loads the configuration
    void
    setup(String fileName)
    Setups the configuration file by provided name.
  • Method Details

    • setup

      void setup(String fileName)
      Setups the configuration file by provided name.
      Parameters:
      fileName - Name of the file to setup
    • isSetup

      boolean isSetup()
      Checks if the configuration is setup
      Returns:
      If the configuration is setup
    • loadConfiguration

      void loadConfiguration()
      Loads the configuration
    • getString

      String getString(String path, String def)
      Returns the String value from the configuration.
      Parameters:
      path - Path in the configuration.
      def - Default value if the path is not set.
      Returns:
      String value from the configuration. Returns "def" if path is not available.
    • getInt

      int getInt(String path, int def)
      Returns the int value from the configuration.
      Parameters:
      path - Path in the configuration.
      def - Default value if the path is not set.
      Returns:
      int value from the configuration. Returns "def" if path is not available.
    • getBoolean

      boolean getBoolean(String path, boolean def)
      Returns the boolean value from the configuration.
      Parameters:
      path - Path in the configuration.
      def - Default value if the path is not set.
      Returns:
      boolean value from the configuration. Returns "def" if path is not available.
    • getStringList

      List<String> getStringList(String path)
      Returns the list of Strings from the configuration.
      Parameters:
      path - Path in the configuration.
      Returns:
      list of strings from the configuration. Returns empty list if path is not available.