Class BoundedPropertyListener<T>

java.lang.Object
johnsmith.configoverhauled.api.listener.AbstractPropertyListener<T>
johnsmith.configoverhauled.api.listener.BoundedPropertyListener<T>
Type Parameters:
T - The underlying comparable data type monitored by this listener.
All Implemented Interfaces:
Property.Listener
Direct Known Subclasses:
ARGBColorPropertyListener, DoublePropertyListener, FloatPropertyListener, IntegerPropertyListener, LongPropertyListener, RGBColorPropertyListener

public abstract class BoundedPropertyListener<T> extends AbstractPropertyListener<T>
Abstract base implementation for dynamic configuration property listeners that enforce value constraints. Extends standard listener functionality to support properties requiring minimum and maximum boundaries.
  • Field Details

    • lowerBound

      protected final T lowerBound
      The minimum permissible value for the dynamically generated property.
    • upperBound

      protected final T upperBound
      The maximum permissible value for the dynamically generated property.
  • Constructor Details

    • BoundedPropertyListener

      protected BoundedPropertyListener(ConfigDescription description, DynamicPropertyTypeRegistry.TypeDefinition<T> typeDefinition, T defaultValue, T lowerBound, T upperBound)
      Constructs a state listener for a bounded dynamic configuration property. Instantiation triggers an immediate and eager resolution of the target property.
      Parameters:
      description - The structural and organizational metadata for the target property.
      typeDefinition - The registry definition mapping the required data type.
      defaultValue - The default value assigned upon initial property generation.
      lowerBound - The absolute minimum value allowed for this property state.
      upperBound - The absolute maximum value allowed for this property state.
  • Method Details

    • resolveProperty

      protected void resolveProperty(boolean forceResolution)
      Resolves the target property from the active configuration manager instance. Overrides the standard resolution pipeline to inject the explicit boundary constraints during the property generation phase.
      Overrides:
      resolveProperty in class AbstractPropertyListener<T>
      Parameters:
      forceResolution - Bypasses the initialization state check to force synchronization.