@Singleton public class SettingsSvc extends java.lang.Object implements SettingsService
SettingsService
.SettingsService.Holder
Constructor and Description |
---|
SettingsSvc(PlanConfig config,
ErrorLogger errorLogger) |
Modifier and Type | Method and 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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance
@Inject public SettingsSvc(PlanConfig config, ErrorLogger errorLogger)
public void register()
public java.lang.String getString(java.lang.String path, java.util.function.Supplier<java.lang.String> defaultValue)
SettingsService
getString
in interface SettingsService
path
- Path in the configdefaultValue
- Supplier for the default value, () -> "Example"
.public <T> void set(java.lang.String pluginPath, java.util.function.Supplier<T> defaultValue)
public java.lang.Integer getInteger(java.lang.String path, java.util.function.Supplier<java.lang.Integer> defaultValue)
SettingsService
getInteger
in interface SettingsService
path
- Path in the configdefaultValue
- Supplier for the default value, () -> 500
.public java.util.List<java.lang.String> getStringList(java.lang.String path, java.util.function.Supplier<java.util.List<java.lang.String>> defaultValue)
SettingsService
getStringList
in interface SettingsService
path
- Path in the configdefaultValue
- Supplier for the default value, () -> Arrays.asList("Example", "Another")
.