Class SettingsSvc

java.lang.Object
com.djrapitops.plan.settings.SettingsSvc
All Implemented Interfaces:
SettingsService

@Singleton public class SettingsSvc extends Object implements SettingsService
Implementation for SettingsService.
  • Constructor Details

  • Method Details

    • register

      public void register()
    • getString

      public String getString(String path, Supplier<String> defaultValue)
      Description copied from interface: SettingsService
      Get a String from the config or the default value.
      Specified by:
      getString in interface SettingsService
      Parameters:
      path - Path in the config
      defaultValue - Supplier for the default value, () -> "Example".
      Returns:
      value in the config
    • set

      public <T> void set(String pluginPath, Supplier<T> defaultValue)
    • getInteger

      public Integer getInteger(String path, Supplier<Integer> defaultValue)
      Description copied from interface: SettingsService
      Get a Integer from the config or the default value.
      Specified by:
      getInteger in interface SettingsService
      Parameters:
      path - Path in the config
      defaultValue - Supplier for the default value, () -> 500.
      Returns:
      value in the config
    • getStringList

      public List<String> getStringList(String path, Supplier<List<String>> defaultValue)
      Description copied from interface: SettingsService
      Get a String list from the config or the default value.
      Specified by:
      getStringList in interface SettingsService
      Parameters:
      path - Path in the config
      defaultValue - Supplier for the default value, () -> Arrays.asList("Example", "Another").
      Returns:
      value in the config