Class LoadSettings
java.lang.Object
com.mrivanplays.annotationconfig.core.resolver.settings.LoadSettings
Represents load settings. They are used upon annotated config load.
- Since:
- 2.0.0
- Author:
- MrIvanPlays
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of the current load settingsstatic LoadSettings
empty()
Creates new empty load settings.<T> Optional<T>
get
(LoadSetting<T> setting) Returns the value held for the specifiedLoadSetting
setting
static LoadSettings
Returns the default load settings.static LoadSettings.Builder
Creates a new emptyLoadSettings.Builder
static LoadSettings.Builder
newBuilder
(boolean fromDefaults) Creates a newLoadSettings.Builder
<T> void
set
(LoadSetting<T> setting, T value)
-
Method Details
-
newBuilder
Creates a new emptyLoadSettings.Builder
- Returns:
- empty builder instance
-
newBuilder
Creates a newLoadSettings.Builder
- Parameters:
fromDefaults
- whether to instantiate load settings fromgetDefault()
- Returns:
- builder instance
-
empty
Creates new empty load settings. If used unmodified on aConfigResolver
, the config resolver will fall back to the default settings (a.kagetDefault()
).- Returns:
- empty load settings
-
getDefault
Returns the default load settings.- Returns:
- defaults
-
get
Returns the value held for the specifiedLoadSetting
setting
- Type Parameters:
T
- value type- Parameters:
setting
- the load setting you want the value for- Returns:
- load setting value optional, which can be empty
-
set
Binds the specifiedvalue
to the specifiedLoadSetting
setting
. If the load setting already has a value, it gets replaced.- Type Parameters:
T
- value type- Parameters:
setting
- the load setting you want the value to be bound tovalue
- the value you want bound
-
copy
Creates a copy of the current load settings- Returns:
- copy
-