Interface MutableProperty<T>

All Superinterfaces:
Functor<T>, Property<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

public interface MutableProperty<T> extends Property<T>
A property whose value can be changed.
  • Method Details

    • swapValue

      default T swapValue(T value)
      Replaces the value with a new value and returns its previous value.
      Parameters:
      value - The new value
      Returns:
      The previous value.
    • modifyValue

      default boolean modifyValue(Mapper<T,T> mapper)
      Applies a mapper to the value of this property.
      Parameters:
      mapper - The mapper to apply
      Returns:
      true if the value was changed.
    • setValue

      boolean setValue(T value)
      Sets the value of this property.
      Parameters:
      value - The new value
      Returns:
      true if the value was changed.
    • viewProperty

      default Property<T> viewProperty()