Either<L, R> class abstract

Either represents a value of two possible types. An Either is either an Either.left or an Either.right.

Annotations

Constructors

Either()
Constructs an Either.
const
Either.left(L value)
The Left version of an Either.
const
factory
Either.right(R value)
The Right version of an Either.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isLeft bool
Returns whether this Either is an Either.left.
no setter
isRight bool
Returns whether this Either is an Either.right.
no setter
left → L
Gets the right value if this is an Either.left or throws if this is a Either.right.
no setter
Gets the right value if this is an Either.right or throws if this is an Either.left.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fold<T>(EitherMapper<T, L> leftMapper, EitherMapper<T, R> rightMapper) → T
Folds either the left or the right side of this disjunction.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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