Success

data class Success<out T>(val value: T) : Resultat<T>

This type represent a successful outcome.

Parameters

value

The encapsulated successful value

Constructors

Link copied to clipboard
fun <out T> Success(value: T)

Functions

Link copied to clipboard
fun exceptionOrNull(): Throwable?

Returns the encapsulated Throwable exception if this instance represents failure or null if it is success or loading.

Link copied to clipboard
inline fun getOrNull(): T?

Returns the encapsulated value if this instance represents success or null if it is failure or Resultat.Loading.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val isFailure: Boolean

Returns true if this instance represents a failed outcome. In this case isSuccess returns false. In this case isLoading returns false.

Link copied to clipboard
val isLoading: Boolean

Returns true if this instance represents a loading outcome. In this case isSuccess returns false. In this case isFailure returns false.

Link copied to clipboard
val isSuccess: Boolean

Returns true if this instance represents a successful outcome. In this case isFailure returns false. In this case isLoading returns false.

Link copied to clipboard
val value: T