T
- the type of the value of the settingpublic static interface AbstractScopedSettings.SettingUpdater<T>
Setting
Modifier and Type | Method and Description |
---|---|
default boolean |
apply(Settings current,
Settings previous)
Updates this updaters value if it has changed.
|
void |
apply(T value,
Settings current,
Settings previous)
Applies the given value to the updater.
|
T |
getValue(Settings current,
Settings previous)
Returns the instance value for the current settings.
|
boolean |
hasChanged(Settings current,
Settings previous)
Returns true if this updaters setting has changed with the current update
|
default java.lang.Runnable |
updater(Settings current,
Settings previous)
Returns a callable runnable that calls
apply(Object, Settings, Settings) if the settings
actually changed. |
boolean hasChanged(Settings current, Settings previous)
current
- the current settingsprevious
- the previous settingT getValue(Settings current, Settings previous)
void apply(T value, Settings current, Settings previous)
default boolean apply(Settings current, Settings previous)
true
iff the value has been updated.default java.lang.Runnable updater(Settings current, Settings previous)
apply(Object, Settings, Settings)
if the settings
actually changed. This allows to defer the update to a later point in time while keeping type safety.
If the value didn't change the returned runnable is a noop.