Package com.djrapitops.plan.settings
Class SettingsSvc
- java.lang.Object
-
- com.djrapitops.plan.settings.SettingsSvc
-
- All Implemented Interfaces:
SettingsService
@Singleton public class SettingsSvc extends java.lang.Object implements SettingsService
Implementation forSettingsService
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.djrapitops.plan.settings.SettingsService
SettingsService.Holder
-
-
Constructor Summary
Constructors Constructor Description SettingsSvc(PlanConfig config, ErrorLogger errorLogger)
-
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)
-
-
-
Constructor Detail
-
SettingsSvc
@Inject public SettingsSvc(PlanConfig config, ErrorLogger errorLogger)
-
-
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 interfaceSettingsService
- Parameters:
path
- Path in the configdefaultValue
- 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 interfaceSettingsService
- Parameters:
path
- Path in the configdefaultValue
- 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 interfaceSettingsService
- Parameters:
path
- Path in the configdefaultValue
- Supplier for the default value,() -> Arrays.asList("Example", "Another")
.- Returns:
- value in the config
-
-