MapObservable

public class MapObservable<T, V> extends BaseObservable<T> implements Observer<T>(source)

An observable that wraps another observable and applies a mapper function to its content.

Parameters

<T>

the type of the wrapped observable

<V>

the type of the mapped observable

See also

Functions

Link copied to clipboard
public void addObserver(Observer<T> observer)
Add a new observer which is interested in updates about this value
Link copied to clipboard
public V get()
Link copied to clipboard
public boolean isValid()
A method to indicate whether an observer is still valid.
Link copied to clipboard
public Observable<V> map<V>(Function<T, V> mapper)
Create a new Observable which will always have the value of mapper.apply(get()) and reports on updates accordingly.
Link copied to clipboard
public void observeChange(T oldT, T newT)
Called when the state is changed.
Link copied to clipboard
public void whenChanged(Observer<T> observer)
Alias for addObserver.