Class ObjectConfigOption<T>
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableObjectProperty<T>
dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty<T>
dev.prozilla.pine.core.state.config.option.ObjectConfigOption<T>
- All Implemented Interfaces:
Destructible,MutableObjectProperty<T>,MutableProperty<T>,ObservableObjectProperty<T>,ObservableProperty<T>,SimpleObservableProperty<T>,Property<T>,Transceivable<ConfigOption<T>>,Transmittable<ConfigOption<T>>,Functor<T>,ConfigOption<T>
- Direct Known Subclasses:
StringConfigOption
public class ObjectConfigOption<T>
extends SimpleObservableObjectProperty<T>
implements ConfigOption<T>
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty
loggerFields inherited from interface dev.prozilla.pine.core.state.config.option.ConfigOption
INITIAL_VALUE_ERRORFields inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
OBSERVER_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionObjectConfigOption(T value) Creates a config option without a validator.ObjectConfigOption(T value, Predicate<T> validator) Creates a config option with a validator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValidValue(T value) Checks whether a value is a valid value for this option.voidreset()Resets this option to its initial value.booleanSets the value of this property.Methods inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty
addObserver, destroy, getLogger, onValueChange, removeObserver, setLoggerMethods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableObjectProperty
getValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.state.config.option.ConfigOption
receive, self, transmitMethods inherited from interface dev.prozilla.pine.common.lifecycle.Destructible
destroyMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableObjectProperty
setNull, stealMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, 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
-
Constructor Details
-
ObjectConfigOption
Creates a config option without a validator.- Parameters:
value- Initial value
-
ObjectConfigOption
Creates a config option with a validator.- Parameters:
value- Initial value- Throws:
IllegalArgumentException- Ifvalidatordoes not evaluate totruefor the initial value.
-
-
Method Details
-
setValue
Description copied from interface:MutablePropertySets the value of this property.- Specified by:
setValuein interfaceMutableProperty<T>- Overrides:
setValuein classSimpleMutableObjectProperty<T>- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
isValidValue
Description copied from interface:ConfigOptionChecks whether a value is a valid value for this option.- Specified by:
isValidValuein interfaceConfigOption<T>- Parameters:
value- Value to check.- Returns:
- True if the value is valid
-
reset
public void reset()Description copied from interface:ConfigOptionResets this option to its initial value.- Specified by:
resetin interfaceConfigOption<T>
-