Class ConfigBindings.Source

java.lang.Object
com.ultikits.ultitools.manager.ConfigBindings.Source
Enclosing class:
ConfigBindings

static final class ConfigBindings.Source extends Object
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 Details

  • Constructor Details

  • Method Details

    • readSeconds

      Long readSeconds()
      Returns:
      the current field value as seconds, or null for a null boxed field
    • enforceOnPanelWrites

      void enforceOnPanelWrites(String rule, Predicate<Long> isValid)
      Makes a panel write that sets this key outside rule's range fail, in the shape of a @Range violation (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_RULE or ConfigBindings.COOLDOWN_RULE
      isValid - 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-back IOException that ConfigManager caught (Codex round 1 on #536). Its fields may then hold values their validation never checked, so the reload step keeps the running value.
      Returns:
      true if the value must not be applied
    • reloadSource

      Supplier<Long> reloadSource()
      A value source for the @CmdCD reload step: reads the field, or throws ConfigBindings.ReloadFailedException when lastReloadFailed().
      Returns:
      the source