Interface MutableBooleanProperty
- All Superinterfaces:
BooleanProperty,Functor<Boolean>,MutableProperty<Boolean>,NonNullProperty<Boolean>,Property<Boolean>
- All Known Subinterfaces:
ObservableBooleanProperty
- All Known Implementing Classes:
BooleanConfigOption,DeserializedBooleanProperty,SimpleMutableBooleanProperty,SimpleObservableBooleanProperty,StoredBooleanProperty
A property with a boolean value that can be changed.
-
Field Summary
Fields inherited from interface dev.prozilla.pine.common.property.BooleanProperty
FALSE, TRUE -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanmodify(BooleanMapper mapper) Applies a mapper to the value of this property.booleanset(boolean value) Sets the value of this property.default booleanSets the value of this property.default booleanswap(boolean value) Replaces the value with a new value and returns its previous value.default voidtoggle()Negates the value of this property.default BooleanPropertyMethods 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.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.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringProperty
-
Method Details
-
setValue
Description copied from interface:MutablePropertySets the value of this property.- Specified by:
setValuein interfaceMutableProperty<Boolean>- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
swap
default boolean swap(boolean value) Replaces the value with a new value and returns its previous value.- Parameters:
value- The new value- Returns:
- The previous value.
-
modify
Applies a mapper to the value of this property.- Parameters:
mapper- The mapper to apply- Returns:
trueif the value was changed.
-
toggle
default void toggle()Negates the value of this property. -
set
boolean set(boolean value) Sets the value of this property.- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
viewProperty
- Specified by:
viewPropertyin interfaceMutableProperty<Boolean>
-