withDefault

public static FutureObserver<T> withDefault<T>(T defaultValue)

Creates a new instance of FutureObserver with the given defaultValue.

The default value is used only if the onNext method is never invoked and the stream is completed. In such case, the future view is completed with the given value.

Return

new FutureObserver

Parameters

defaultValue

the default value to complete the future with

<T>

the type of the observed stream