Right<L, R> class final

Represents the right side of Either (typically a success value)

Inheritance
Available extensions

Constructors

Right.new(R value)
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isLeft bool
Returns true if this is a Left
no setterinherited
isRight bool
Returns true if this is a Right
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → R
final

Methods

filter(bool predicate(R), L orElse()) Either<L, R>

Available on Either<L, R>, provided by the EitherExtensions extension

Filters the right value with a predicate, converting to Left if false
flatMap<R2>(Either<L, R2> f(R)) Either<L, R2>
Flat maps the right value if this is a Right
inherited
flatMapLeft<L2>(Either<L2, R> f(L)) Either<L2, R>
Flat maps the left value if this is a Left
inherited
fold<T>(T onLeft(L), T onRight(R)) → T
Folds this Either into a single value
inherited
getOrElse(R defaultValue) → R
Returns the right value if this is a Right, otherwise returns the default value
inherited
getOrElseGet(R defaultValue()) → R
Returns the right value if this is a Right, otherwise computes and returns a default value
inherited
map<R2>(R2 f(R)) Either<L, R2>
Maps the right value if this is a Right, otherwise returns this Left unchanged
inherited
mapLeft<L2>(L2 f(L)) Either<L2, R>
Maps the left value if this is a Left, otherwise returns this Right unchanged
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
swap() Either<R, L>
Swaps Left and Right
inherited
toList() List<R>

Available on Either<L, R>, provided by the EitherExtensions extension

Converts this Either to a list, containing the right value or empty for Left
toNullable() → R?

Available on Either<L, R>, provided by the EitherExtensions extension

Converts this Either to a nullable value, returning null for Left
toString() String
A string representation of this object.
inherited

Operators

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