Class SettingsSvc

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      void register()  
      <T> void set​(java.lang.String pluginPath, java.util.function.Supplier<T> defaultValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • register

        public void register()
      • getString

        public java.lang.String getString​(java.lang.String path,
                                          java.util.function.Supplier<java.lang.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​(java.lang.String pluginPath,
                            java.util.function.Supplier<T> defaultValue)
      • getInteger

        public java.lang.Integer getInteger​(java.lang.String path,
                                            java.util.function.Supplier<java.lang.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 java.util.List<java.lang.String> getStringList​(java.lang.String path,
                                                              java.util.function.Supplier<java.util.List<java.lang.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