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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final TThe minimum permissible value for the dynamically generated property.protected final TThe maximum permissible value for the dynamically generated property.Fields inherited from class AbstractPropertyListener
cachedProperty, defaultValue, description, initialized, typeDefinition -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBoundedPropertyListener(ConfigDescription description, DynamicPropertyTypeRegistry.TypeDefinition<T> typeDefinition, T defaultValue, T lowerBound, T upperBound) Constructs a state listener for a bounded dynamic configuration property. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidresolveProperty(boolean forceResolution) Resolves the target property from the active configuration manager instance.Methods inherited from class AbstractPropertyListener
onPropertyChanged, onPropertyInvalidated
-
Field Details
-
lowerBound
The minimum permissible value for the dynamically generated property. -
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:
resolvePropertyin classAbstractPropertyListener<T>- Parameters:
forceResolution- Bypasses the initialization state check to force synchronization.
-