Interface ConfigOption<T>
- Type Parameters:
T- The type of the value
- All Superinterfaces:
Destructible,Functor<T>,MutableProperty<T>,ObservableProperty<T>,Property<T>,SimpleObservableProperty<T>,Transceivable<ConfigOption<T>>,Transmittable<ConfigOption<T>>
- All Known Implementing Classes:
BooleanConfigOption,FloatConfigOption,IntConfigOption,ObjectConfigOption,StringConfigOption
public interface ConfigOption<T>
extends SimpleObservableProperty<T>, Transceivable<ConfigOption<T>>
Represents an option of the application's configuration.
Every option has an initial value and a validator which restricts the values of the option.
- See Also:
-
Field Summary
FieldsFields inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
OBSERVER_ERROR -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValidValue(T value) Checks whether a value is a valid value for this option.default voidreceive(ConfigOption<T> source) Copies the value of another option to this option.voidreset()Resets this option to its initial value.default ConfigOption<T> self()default voidtransmit(ConfigOption<T> target) Copies the value of this option to another option.Methods inherited from interface dev.prozilla.pine.common.lifecycle.Destructible
destroyMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, setValue, swapValue, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
addObserver, read, removeObserverMethods inherited from interface dev.prozilla.pine.common.property.Property
getValue, getValueOr, hasValue, hasValueProperty, isNotNull, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot, toStringPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.SimpleObservableProperty
setLogger
-
Field Details
-
INITIAL_VALUE_ERROR
- See Also:
-
-
Method Details
-
transmit
Copies the value of this option to another option.- Specified by:
transmitin interfaceTransceivable<T>- Specified by:
transmitin interfaceTransmittable<T>- Parameters:
target- The target object to transmit data to
-
receive
Copies the value of another option to this option.- Specified by:
receivein interfaceTransceivable<T>- Parameters:
source- The object from which data will be received
-
isValidValue
Checks whether a value is a valid value for this option.- Parameters:
value- Value to check.- Returns:
- True if the value is valid
-
reset
void reset()Resets this option to its initial value. -
self
- Specified by:
selfin interfaceTransceivable<T>
-