Interface IConfigValueEditorInfo<T>

Type Parameters:
T - an effectively immutable value type with stable Object.equals(Object) behavior

@NonExtendable public interface IConfigValueEditorInfo<T>
Provides the saved state, identity, presentation metadata, and listener hooks needed by config editors.

Get this from IConfigValue.getEditorInfo(). Regular feature code should normally use the value methods on IConfigValue.

Since:
0.3.0
  • Method Details

    • getPendingValue

      T getPendingValue()
      Get the saved value, including a restart-required change that is not effective yet.

      This equals IConfigValue.get() when no restart is required or no change is pending. Setting this back to the effective value cancels a pending change. Synchronized remote server schemas replicate effective values only, so their pending value always equals their effective value.

      Since:
      0.3.0
    • getDefaultValue

      T getDefaultValue()
      Get the default value.

      Values are immutable by contract. Built-in list values return an unmodifiable snapshot.

      Since:
      0.3.0
    • getName

      String getName()
      Get the stable storage name of this config value.
      Since:
      0.3.0
    • getLocalizationKey

      String getLocalizationKey()
      Get the translation key used for this config value's name.
      Since:
      0.3.0
    • getEditMode

      ConfigValueEditMode getEditMode()
      Get the edit mode hint for this value.
      Since:
      0.3.0
    • getRestartRequirement

      ConfigValueRestartRequirement getRestartRequirement()
      Get the lifecycle boundary when saved changes become effective.
      Since:
      0.3.0
    • getEditorCategories

      @Unmodifiable List<? extends IConfigEditorCategory> getEditorCategories()
      Get the categories where config editors should show this value.

      If this is empty, config editors can show the value in the category that contains it. Values may be shown in multiple editor categories. Categories are returned in editor category order from IConfigSchema.getEditorCategories().

      Since:
      0.3.0
    • addPendingListener

      Runnable addPendingListener(IConfigValueChangeListener<T> listener)
      Run code when this setting's getPendingValue() changes, even if it is waiting for a restart.
      Parameters:
      listener - callback accepting the pending change
      Returns:
      a callback that removes this listener
      Since:
      0.3.0
    • addPendingBatchListener

      Runnable addPendingBatchListener(IConfigValueBatchChangeListener listener)
      Observe the complete saved-value batch whenever it includes this setting.
      Parameters:
      listener - callback accepting the pending changes
      Returns:
      a callback that removes this listener
      Since:
      0.3.0
    • getSerializer

      IConfigValueSerializer<T> getSerializer()
      Get this setting's serializer for validation and editor integration.
      Since:
      0.3.0