Interface MutableProperty<T>
- All Known Subinterfaces:
ConfigOption<T>,MutableBooleanProperty,MutableFloatProperty,MutableIntProperty,MutableObjectProperty<T>,MutableStringProperty,ObservableBooleanProperty,ObservableFloatProperty,ObservableIntProperty,ObservableObjectProperty<T>,ObservableProperty<T>,ObservableStringProperty,SimpleObservableProperty<T>
- All Known Implementing Classes:
AnalogInputProperty,BooleanConfigOption,DeserializedBooleanProperty,DeserializedFloatProperty,DeserializedIntProperty,DeserializedObjectProperty,DeserializedStringProperty,FileDeserializer,FloatConfigOption,GamepadAxesProperty,GamepadAxisProperty,GamepadButtonProperty,GamepadButtonsProperty,HotFileDeserializer,IntConfigOption,KeyboardKeyProperty,KeyboardKeysProperty,MouseButtonProperty,MouseButtonsProperty,ObjectConfigOption,RangedMutableIntProperty,SelectionProperty,SimpleMutableBooleanProperty,SimpleMutableFloatProperty,SimpleMutableIntProperty,SimpleMutableObjectProperty,SimpleMutableStringProperty,SimpleObservableBooleanProperty,SimpleObservableFloatProperty,SimpleObservableIntProperty,SimpleObservableObjectProperty,SimpleObservableStringProperty,SingleSelectionProperty,StoredBooleanProperty,StoredFloatProperty,StoredIntProperty,StoredProperty,StoredStringProperty,StringConfigOption,SystemProperty
A property whose value can be changed.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanmodifyValue(Mapper<T, T> mapper) Applies a mapper to the value of this property.booleanSets the value of this property.default TReplaces the value with a new value and returns its previous value.Methods inherited from interface dev.prozilla.pine.common.property.Property
getValue, getValueOr, hasValue, hasValueProperty, isNotNull, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot, toStringProperty
-
Method Details
-
swapValue
Replaces the value with a new value and returns its previous value.- Parameters:
value- The new value- Returns:
- The previous value.
-
modifyValue
Applies a mapper to the value of this property.- Parameters:
mapper- The mapper to apply- Returns:
trueif the value was changed.
-
setValue
Sets the value of this property.- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
viewProperty
-