Class BooleanConfigOption
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableBooleanProperty
dev.prozilla.pine.common.property.observable.SimpleObservableBooleanProperty
dev.prozilla.pine.core.state.config.option.BooleanConfigOption
- All Implemented Interfaces:
Destructible,BooleanProperty,MutableBooleanProperty,MutableProperty<Boolean>,NonNullProperty<Boolean>,ObservableBooleanProperty,ObservableProperty<Boolean>,SimpleObservableProperty<Boolean>,Property<Boolean>,Transceivable<ConfigOption<Boolean>>,Transmittable<ConfigOption<Boolean>>,Functor<Boolean>,ConfigOption<Boolean>
public class BooleanConfigOption
extends SimpleObservableBooleanProperty
implements ConfigOption<Boolean>
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableBooleanProperty
loggerFields inherited from interface dev.prozilla.pine.common.property.BooleanProperty
FALSE, TRUEFields 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
ConstructorsConstructorDescriptionBooleanConfigOption(boolean value) Creates a config option without a validator.BooleanConfigOption(boolean value, BooleanPredicate validator) Creates a config option with a validator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(boolean value) booleanisValidValue(Boolean value) Checks whether a value is a valid value for this option.voidreceive(BooleanConfigOption otherOption) voidreset()Resets this option to its initial value.booleanset(boolean value) Sets the value of this property.booleanSets the value of this option.voidtransmit(BooleanConfigOption otherOption) Methods inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableBooleanProperty
addObserver, destroy, getLogger, onValueChange, removeObserver, setLoggerMethods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableBooleanProperty
getMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.BooleanProperty
and, and, get, getValue, getValueOr, has, hasProperty, ifElse, map, not, or, or, replaceNull, requireValue, xor, xorMethods 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.MutableBooleanProperty
modify, swap, toggle, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, swapValueMethods inherited from interface dev.prozilla.pine.common.property.NonNullProperty
isNotNull, isNotNullPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.ObservableBooleanProperty
addObserver, read, read, removeObserverMethods inherited from interface dev.prozilla.pine.common.property.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.SimpleObservableProperty
setLogger
-
Constructor Details
-
BooleanConfigOption
public BooleanConfigOption(boolean value) Creates a config option without a validator.- Parameters:
value- Initial value
-
BooleanConfigOption
public BooleanConfigOption(boolean value, BooleanPredicate validator) throws IllegalArgumentException Creates a config option with a validator.- Parameters:
value- Initial value- Throws:
IllegalArgumentException- Ifvalidatordoes not evaluate totruefor the initial value.
-
-
Method Details
-
setValue
Sets the value of this option.- Specified by:
setValuein interfaceMutableBooleanProperty- Specified by:
setValuein interfaceMutableProperty<Boolean>- Parameters:
value- New value for this option- Returns:
trueif the value was changed.
-
set
public boolean set(boolean value) Description copied from interface:MutableBooleanPropertySets the value of this property.- Specified by:
setin interfaceMutableBooleanProperty- Overrides:
setin classSimpleMutableBooleanProperty- 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<Boolean>- Parameters:
value- Value to check.- Returns:
- True if the value is valid
-
isValid
public boolean isValid(boolean value) -
transmit
-
receive
-
reset
public void reset()Description copied from interface:ConfigOptionResets this option to its initial value.- Specified by:
resetin interfaceConfigOption<Boolean>
-