T
- the type of event message to producepublic class ObservablePropertyImpl<T> extends java.lang.Object implements ObservableProperty<T>
ObservableProperty
which maintains a list
of listeners to receive change events fired with set(Object)
.
Addition and removal of observers, as well as the firing of events, are synchronized on the implementation object.
ObservableValue.Change<T>
Constructor and Description |
---|
ObservablePropertyImpl(T initialValue) |
ObservablePropertyImpl(java.lang.Throwable initialProblem) |
Modifier and Type | Method and Description |
---|---|
Observable<ObservableValue.Change<T>> |
changes() |
ObservableValue<T> |
currentState() |
T |
get()
Immediately resolve the current value if one exists, otherwise throw a
MissingValueException with a cause representing the current failure
state. |
Disposable |
observe(Observer<? super T> observer)
Observers added will receive messages from this Observable.
|
T |
set(T value)
Set the value of this property to the given value.
|
void |
setProblem(java.lang.Throwable t) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
over, tryGet
getProblem, isEqual, isMatching, isValid, tryGetProblem
aggregateBackpressure, aggregateBackpressure, collect, collectBackpressure, compose, concat, concat, concatMap, dropWhile, empty, executeOn, failingValue, filter, flatMap, getNext, map, materialize, merge, merge, mergeMap, observe, of, of, of, reduce, reduceBackpressure, reduceBackpressure, reduceBackpressure, repeating, requestNext, requestUnbounded, retrying, softReference, softReference, synchronize, synchronize, takeWhile, then, thenAfter, toObservable, toValue, toValue, toValue, upcast, value, weakReference, weakReference
map, over, setDefault, unset
public ObservablePropertyImpl(T initialValue)
public ObservablePropertyImpl(java.lang.Throwable initialProblem)
public Observable<ObservableValue.Change<T>> changes()
changes
in interface ObservableValue<T>
public ObservableValue<T> currentState()
public Disposable observe(Observer<? super T> observer)
Observable
observe
in interface Observable<T>
observer
- an observer to addpublic T set(T value)
Property
public void setProblem(java.lang.Throwable t)
setProblem
in interface ObservableProperty<T>
public T get()
ObservableValue
MissingValueException
with a cause representing the current failure
state.get
in interface Observable<T>
get
in interface ObservableValue<T>
get
in interface Property<T>