Class WritableValue<T>

  • Type Parameters:
    T - the type of value being observed
    All Implemented Interfaces:
    IObservable, IObservableValue<T>

    public class WritableValue<T>
    extends AbstractObservableValue<T>
    Mutable (writable) implementation of IObservableValue that will maintain a value and fire change events when the value changes.

    This class is thread safe. All state accessing methods must be invoked from the current realm. Methods for adding and removing listeners may be invoked from any thread.

    Since:
    1.0
    • Constructor Detail

      • WritableValue

        public WritableValue()
        Constructs a new instance with the default realm, a null value type, and a null value.
      • WritableValue

        public WritableValue​(T initialValue,
                             Object valueType)
        Constructs a new instance with the default realm.
        Parameters:
        initialValue - can be null
        valueType - can be null
      • WritableValue

        public WritableValue​(Realm realm)
        Constructs a new instance with the provided realm, a null value type, and a null initial value.
        Parameters:
        realm -
      • WritableValue

        public WritableValue​(Realm realm,
                             T initialValue,
                             Object valueType)
        Constructs a new instance.
        Parameters:
        realm -
        initialValue - can be null
        valueType - can be null