public interface SettingsService
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
Modifier and Type | Interface and Description |
---|---|
static class |
SettingsService.Holder |
Modifier and Type | Method and 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.
|
static SettingsService getInstance()
java.lang.String getString(java.lang.String path, java.util.function.Supplier<java.lang.String> defaultValue)
path
- Path in the configdefaultValue
- Supplier for the default value, () -> "Example"
.java.lang.Integer getInteger(java.lang.String path, java.util.function.Supplier<java.lang.Integer> defaultValue)
path
- Path in the configdefaultValue
- Supplier for the default value, () -> 500
.java.util.List<java.lang.String> getStringList(java.lang.String path, java.util.function.Supplier<java.util.List<java.lang.String>> defaultValue)
path
- Path in the configdefaultValue
- Supplier for the default value, () -> Arrays.asList("Example", "Another")
.