Left<L, R> class
final
Represents a failure or error case.
Two Lefts are equal when they have exactly the same runtime type
(including type arguments) and equal values, so == is symmetric:
Left<String, int>('x') never equals Left<String, num>('x').
- Inheritance
- Available extensions
Constructors
- Left(L value)
- Creates a Left with the given value. If EitherConfig.errorLogger is set and in debug mode, logs a non-null error value.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isLeft → bool
-
Available on Either<
ReturnsL, R> , provided by the EitherExtensions extensiontrueif this is a Left.no setter - isRight → bool
-
Available on Either<
ReturnsL, R> , provided by the EitherExtensions extensiontrueif this is a Right.no setter - left → L?
-
Available on Either<
Returns the Left value if present, otherwiseL, R> , provided by the EitherExtensions extensionnull.no setter - right → R?
-
Available on Either<
Returns the Right value if present, otherwiseL, R> , provided by the EitherExtensions extensionnull.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → L
-
The failure held by this Left.
final
Methods
-
fold<
T> (T leftFn(L l), T rightFn(R r)) → T -
Applies
leftFnif this is a Left, orrightFnif this is a Right.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override