Package com.ultikits.ultitools.manager
Class ConfigBindings.Source
java.lang.Object
com.ultikits.ultitools.manager.ConfigBindings.Source
- Enclosing class:
ConfigBindings
A resolved binding: the module's config entity and the
@ConfigEntry field a key
names. The entity is reloaded in place, so reading the field again after a reload sees the
reloaded value.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) String(package private) voidenforceOnPanelWrites(String rule, Predicate<Long> isValid) Makes a panel write that sets this key outsiderule's range fail, in the shape of a@Rangeviolation (module gate-1 review, UltiChat round 2 WR-06).(package private) booleanWhether this entity's last load or reload did not complete its validation -- for example a write-backIOExceptionthatConfigManagercaught (Codex round 1 on #536).(package private) LongA value source for the@CmdCDreload step: reads the field, or throwsConfigBindings.ReloadFailedExceptionwhenlastReloadFailed().
-
Field Details
-
entity
-
field
-
key
-
-
Constructor Details
-
Source
Source(AbstractConfigEntity entity, Field field, String key)
-
-
Method Details
-
readSeconds
Long readSeconds()- Returns:
- the current field value as seconds, or
nullfor anullboxed field
-
enforceOnPanelWrites
Makes a panel write that sets this key outsiderule's range fail, in the shape of a@Rangeviolation (module gate-1 review, UltiChat round 2 WR-06). Called once the value has passed the same range check at load.- Parameters:
rule-ConfigBindings.TIMER_RULEorConfigBindings.COOLDOWN_RULEisValid- the matching range check
-
configName
String configName()- Returns:
- the entity's simple class name, for messages
-
lastReloadFailed
boolean lastReloadFailed()Whether this entity's last load or reload did not complete its validation -- for example a write-backIOExceptionthatConfigManagercaught (Codex round 1 on #536). Its fields may then hold values their validation never checked, so the reload step keeps the running value.- Returns:
trueif the value must not be applied
-
reloadSource
A value source for the@CmdCDreload step: reads the field, or throwsConfigBindings.ReloadFailedExceptionwhenlastReloadFailed().- Returns:
- the source
-