Result

class Result<out T>

Class which presents the result. Successful result as T value, unsuccessful result as Throwable exception.

Types

Link copied to clipboard
object Companion

Result companion object.

Properties

Link copied to clipboard

Returns true if this instance presents an unsuccessful result.

Link copied to clipboard

Returns true if this instance presents a successful result.

Functions

Link copied to clipboard

Returns error as Throwable if this instance presents an unsuccessful result. Otherwise returns null.

Link copied to clipboard
fun get(): T

Returns value as T if this instance presents a successful result. Otherwise throws the IllegalStateException exception

Link copied to clipboard

Returns error as Throwable if this instance presents an unsuccessful result. Otherwise throws the IllegalStateException exception.

Link copied to clipboard
fun getOrNull(): T?

Returns value as T if this instance presents a successful result. Otherwise returns null.