resultValueOrDefault

inline fun <R : T, T> ObservableOptional<T>.resultValueOrDefault(defaultValue: R): R

Casts the value of an ObservableOptional to its subtype R or returns defaultValue if no such casting is possible.

Return

The current value R if it exists or defaultValue

Parameters

defaultValue

The default R to be returned if ObservableOptional.valueOrNull is not R or null.