Uses of Interface
io.vavr.control.Either
-
Packages that use Either Package Description io.vavr BesideAPI
the io.vavr package contains core types like (Checked)Functions and Tuples.io.vavr.control -
-
Uses of Either in io.vavr
Methods in io.vavr that return Either Modifier and Type Method Description default <L> Either<L,T>
Value. toEither(java.util.function.Supplier<? extends L> leftSupplier)
Converts this to anEither
.default <L> Either<L,T>
Value. toEither(L left)
Converts this to anEither
.default <R> Either<T,R>
Value. toLeft(java.util.function.Supplier<? extends R> right)
Deprecated.UseValue.toEither(Supplier)
instead.default <R> Either<T,R>
Value. toLeft(R right)
Deprecated.UseValue.toEither(Object)
instead.default <L> Either<L,T>
Value. toRight(java.util.function.Supplier<? extends L> left)
Deprecated.UseValue.toEither(Supplier)
instead.default <L> Either<L,T>
Value. toRight(L left)
Deprecated.UseValue.toEither(Object)
instead. -
Uses of Either in io.vavr.control
Classes in io.vavr.control that implement Either Modifier and Type Class Description static class
Either.Left<L,R>
TheLeft
version of anEither
.static class
Either.Right<L,R>
TheRight
version of anEither
.Fields in io.vavr.control declared as Either Modifier and Type Field Description private Either<L,R>
Either.LeftProjection. either
Deprecated.private Either<L,R>
Either.RightProjection. either
Deprecated.Methods in io.vavr.control that return Either Modifier and Type Method Description default <X,Y>
Either<X,Y>Either. bimap(java.util.function.Function<? super L,? extends X> leftMapper, java.util.function.Function<? super R,? extends Y> rightMapper)
Maps either the left or the right side of this disjunction.default Either<L,R>
Either. filterOrElse(java.util.function.Predicate<? super R> predicate, java.util.function.Function<? super R,? extends L> zero)
Filters this right-biasedEither
by testing a predicate.default <U> Either<L,U>
Either. flatMap(java.util.function.Function<? super R,? extends Either<L,? extends U>> mapper)
FlatMaps this right-biased Either.static <L,R>
Either<L,R>Either. left(L left)
Constructs aEither.Left
default <U> Either<L,U>
Either. map(java.util.function.Function<? super R,? extends U> mapper)
Maps the value of this Either if it is a Right, performs no operation if this is a Left.default <U> Either<U,R>
Either. mapLeft(java.util.function.Function<? super L,? extends U> leftMapper)
Maps the value of this Either if it is a Left, performs no operation if this is a Right.static <L,R>
Either<L,R>Either. narrow(Either<? extends L,? extends R> either)
Narrows a widenedEither<? extends L, ? extends R>
toEither<L, R>
by performing a type-safe cast.default Either<L,R>
Either. orElse(Either<? extends L,? extends R> other)
default Either<L,R>
Either. orElse(java.util.function.Supplier<? extends Either<? extends L,? extends R>> supplier)
default Either<L,R>
Either. peek(java.util.function.Consumer<? super R> action)
default Either<L,R>
Either. peekLeft(java.util.function.Consumer<? super L> action)
static <L,R>
Either<L,R>Either. right(R right)
Constructs aEither.Right
static <L,R>
Either<Seq<L>,Seq<R>>Either. sequence(java.lang.Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces manyEither
s into a singleEither
by transforming anIterable<Either<L, R>>
into aEither<Seq<L>, Seq<R>>
.static <L,R>
Either<L,Seq<R>>Either. sequenceRight(java.lang.Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces manyEither
s into a singleEither
by transforming anIterable<Either<L, R>>
into aEither<L, Seq<R>>
.default Either<R,L>
Either. swap()
Converts aLeft
to aRight
vice versa by wrapping the value in a new type.Either<L,R>
Either.LeftProjection. toEither()
Deprecated.Returns the underlying either of this projection.Either<L,R>
Either.RightProjection. toEither()
Deprecated.Returns the underlying either of this projection.default Either<java.lang.Throwable,T>
Try. toEither()
Converts thisTry
to anEither
.default Either<E,T>
Validation. toEither()
Converts this Validation to anEither
.static <L,R,T>
Either<Seq<L>,Seq<R>>Either. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleEither
by transforming anIterable<? extends T>
into aEither<Seq<U>>
.static <L,R,T>
Either<L,Seq<R>>Either. traverseRight(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleEither
by transforming anIterable<? extends T>
into aEither<Seq<U>>
.Methods in io.vavr.control that return types with arguments of type Either Modifier and Type Method Description default Option<Either<L,R>>
Either. filter(java.util.function.Predicate<? super R> predicate)
Filters this right-biasedEither
by testing a predicate.Methods in io.vavr.control with parameters of type Either Modifier and Type Method Description static <E,T>
Validation<E,T>Validation. fromEither(Either<E,T> either)
Creates aValidation
of anEither
.static <L,R>
Either<L,R>Either. narrow(Either<? extends L,? extends R> either)
Narrows a widenedEither<? extends L, ? extends R>
toEither<L, R>
by performing a type-safe cast.default Either<L,R>
Either. orElse(Either<? extends L,? extends R> other)
Method parameters in io.vavr.control with type arguments of type Either Modifier and Type Method Description default <U> Either<L,U>
Either. flatMap(java.util.function.Function<? super R,? extends Either<L,? extends U>> mapper)
FlatMaps this right-biased Either.default Either<L,R>
Either. orElse(java.util.function.Supplier<? extends Either<? extends L,? extends R>> supplier)
static <L,R>
Either<Seq<L>,Seq<R>>Either. sequence(java.lang.Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces manyEither
s into a singleEither
by transforming anIterable<Either<L, R>>
into aEither<Seq<L>, Seq<R>>
.static <L,R>
Either<L,Seq<R>>Either. sequenceRight(java.lang.Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces manyEither
s into a singleEither
by transforming anIterable<Either<L, R>>
into aEither<L, Seq<R>>
.static <L,R,T>
Either<Seq<L>,Seq<R>>Either. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleEither
by transforming anIterable<? extends T>
into aEither<Seq<U>>
.static <L,R,T>
Either<L,Seq<R>>Either. traverseRight(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleEither
by transforming anIterable<? extends T>
into aEither<Seq<U>>
.Constructors in io.vavr.control with parameters of type Either Constructor Description LeftProjection(Either<L,R> either)
Deprecated.RightProjection(Either<L,R> either)
Deprecated.
-