Success

data class Success<out V>(value: V) : Either<V, Nothing>

Successful result with value value.

Parameters

V

Type of the value.

Constructors

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

Functions

Link copied to clipboard
open override fun error(): Nothing?

Returns the error associated. In case of Success, error will be null.

Link copied to clipboard
open override fun value(): V

Returns the value associated. In case of Failure, value will be null.

Properties

Link copied to clipboard
val isFailure: Boolean

True if the result is an error, false otherwise.

Link copied to clipboard
val isSuccess: Boolean

True if the result was successful, false otherwise.

Link copied to clipboard
val value: V