Class SpigotConfigAdapter

java.lang.Object
cz.foresttech.forestredis.spigot.adapter.SpigotConfigAdapter
All Implemented Interfaces:
IConfigurationAdapter

public class SpigotConfigAdapter extends Object implements IConfigurationAdapter
Implementation of IConfigurationAdapter for Spigot version
  • Constructor Details

    • SpigotConfigAdapter

      public SpigotConfigAdapter(org.bukkit.plugin.java.JavaPlugin plugin)
      Constructs the instance of adapter.
      Parameters:
      plugin - JavaPlugin instance
  • Method Details

    • setup

      public void setup(String fileName)
      Description copied from interface: IConfigurationAdapter
      Setups the configuration file by provided name.
      Specified by:
      setup in interface IConfigurationAdapter
      Parameters:
      fileName - Name of the file to setup
    • isSetup

      public boolean isSetup()
      Description copied from interface: IConfigurationAdapter
      Checks if the configuration is setup
      Specified by:
      isSetup in interface IConfigurationAdapter
      Returns:
      If the configuration is setup
    • loadConfiguration

      public void loadConfiguration()
      Description copied from interface: IConfigurationAdapter
      Loads the configuration
      Specified by:
      loadConfiguration in interface IConfigurationAdapter
    • getString

      public String getString(String path, String def)
      Description copied from interface: IConfigurationAdapter
      Returns the String value from the configuration.
      Specified by:
      getString in interface IConfigurationAdapter
      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

      public int getInt(String path, int def)
      Description copied from interface: IConfigurationAdapter
      Returns the int value from the configuration.
      Specified by:
      getInt in interface IConfigurationAdapter
      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

      public boolean getBoolean(String path, boolean def)
      Description copied from interface: IConfigurationAdapter
      Returns the boolean value from the configuration.
      Specified by:
      getBoolean in interface IConfigurationAdapter
      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

      public List<String> getStringList(String path)
      Description copied from interface: IConfigurationAdapter
      Returns the list of Strings from the configuration.
      Specified by:
      getStringList in interface IConfigurationAdapter
      Parameters:
      path - Path in the configuration.
      Returns:
      list of strings from the configuration. Returns empty list if path is not available.