Interface SettingsService


  • public interface SettingsService
    Service for defining plugin specific settings to the Plan config.

    All given paths will be prepended with "Plugins." to place the settings in the plugins config section. It is recommended to use setting paths "<Plugin_name>.Some_setting"

    Requires Capability SETTINGS_API

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  SettingsService.Holder  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static SettingsService getInstance()  
      java.lang.Integer getInteger​(java.lang.String path, java.util.function.Supplier<java.lang.Integer> defaultValue)
      Get a Integer from the config or the default value.
      java.lang.String getString​(java.lang.String path, java.util.function.Supplier<java.lang.String> defaultValue)
      Get a String from the config or the default value.
      java.util.List<java.lang.String> getStringList​(java.lang.String path, java.util.function.Supplier<java.util.List<java.lang.String>> defaultValue)
      Get a String list from the config or the default value.
    • Method Detail

      • getString

        java.lang.String getString​(java.lang.String path,
                                   java.util.function.Supplier<java.lang.String> defaultValue)
        Get a String from the config or the default value.
        Parameters:
        path - Path in the config
        defaultValue - Supplier for the default value, () -> "Example".
        Returns:
        value in the config
      • getInteger

        java.lang.Integer getInteger​(java.lang.String path,
                                     java.util.function.Supplier<java.lang.Integer> defaultValue)
        Get a Integer from the config or the default value.
        Parameters:
        path - Path in the config
        defaultValue - Supplier for the default value, () -> 500.
        Returns:
        value in the config
      • getStringList

        java.util.List<java.lang.String> getStringList​(java.lang.String path,
                                                       java.util.function.Supplier<java.util.List<java.lang.String>> defaultValue)
        Get a String list from the config or the default value.
        Parameters:
        path - Path in the config
        defaultValue - Supplier for the default value, () -> Arrays.asList("Example", "Another").
        Returns:
        value in the config