DatumEither<L, R> class sealed

A sealed class representing a value that can be one of two types.

This is often used to represent a value that can be either a success or a failure. By convention, L is the error type and R is the success type.

Implementers

Properties

errorOrNull → L?
Returns the error value, or null if this is a Success.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
successOrNull → R?
Returns the success value, or null if this is a Failure.
no setter

Methods

fold<T>(T onFailure(L l, StackTrace? s), T onSuccess(R r)) → T
Folds the Either into a single value.
getError() → (L, StackTrace?)
Returns the failure value, or throws an exception if this is a Success.
getSuccess() → R
isFailure() bool
Returns true if this is a Failure.
isSuccess() bool
Returns true if this is a Success.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFailure(void onFailure(L l, StackTrace? s)) → void
Performs an action on the failure value.
onSuccess(void onSuccess(R r)) → void
Performs an action on the success value.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited