ObservableOptional

Result type for a BaseObservable. Used to allow for the distinction between null and optional values.

Parameters

T

the type this ObservableOptional represents. Can be a nullable.

Inheritors

Types

Link copied to clipboard

The Observable does not have a result.

Link copied to clipboard
data class Value<T>(val value: T) : ObservableOptional<T>

The BaseObservable has a result, this result could be null.

Properties

Link copied to clipboard
abstract val valueOrNull: T?

The value of T or null if this result is Nothing.

Functions

Link copied to clipboard

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

Link copied to clipboard
abstract operator fun getValue(thisRef: Any?, property: KProperty<*>): T?
Link copied to clipboard
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.