Reply

sealed interface Reply<out T>

Represents a reply from a query or mutation.

None indicates that there is no reply yet.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data object None : Reply<Nothing>
Link copied to clipboard
data class Some<out T> : Reply<T>

Properties

Link copied to clipboard

Returns true if the reply is Reply.None.

Functions

Link copied to clipboard
fun <T> Reply<T>.getOrElse(default: () -> T): T

Returns the value of the Reply.Some instance, or the result of the default function if there is no reply yet (Reply.None).

Link copied to clipboard
fun <T> Reply<T>.getOrNull(): T?

Returns the value of the Reply.Some instance, or null if there is no reply yet (Reply.None).

Link copied to clipboard
fun <T> Reply<T>.getOrThrow(): T

Returns the value of the Reply.Some instance, or throws an error if there is no reply yet (Reply.None).

Link copied to clipboard
inline fun <T, R> Reply<T>.map(transform: (T) -> R): Reply<R>

Transforms the value of the Reply.Some instance using the provided transform function, or returns Reply.None if there is no reply yet (Reply.None).

Link copied to clipboard
inline fun <T> Reply<T>?.orNone(): Reply<T>

Returns the value of the Reply.Some instance, or the default value if there is no reply yet (Reply.None).