Skip to main content
Data Class

Constructors

Properties

PropertyTypeDescription
valueT-

Functions

FunctionDescription
flatMapChains a success through transform, which itself returns a Result.
foldApplies onSuccess or onFailure depending on the result variant.
getOrNullReturns the success value, or null if this is a Result.Failure.
getOrThrowReturns the success value, or throws if this is a Result.Failure.
mapTransforms the success value using transform, leaving failures unchanged.
mapErrorTransforms the error using transform, leaving successes unchanged.

flatMap

Chains a success through transform, which itself returns a Result.

fold

Applies onSuccess or onFailure depending on the result variant.

getOrNull

Returns the success value, or null if this is a Result.Failure.

getOrThrow

Returns the success value, or throws if this is a Result.Failure.

map

Transforms the success value using transform, leaving failures unchanged.

mapError

Transforms the error using transform, leaving successes unchanged.