Package | Description |
---|---|
io.vavr |
Beside
API the io.vavr package contains core types like (Checked)Functions and Tuples. |
io.vavr.control |
Modifier and Type | Method and Description |
---|---|
default <L> Either<L,T> |
Value.toEither(L left)
Converts this to an
Either . |
default <L> Either<L,T> |
Value.toEither(Supplier<? extends L> leftSupplier)
Converts this to an
Either . |
default <R> Either<T,R> |
Value.toLeft(R right)
Deprecated.
Use
Value.toEither(Object) instead. |
default <R> Either<T,R> |
Value.toLeft(Supplier<? extends R> right)
Deprecated.
Use
Value.toEither(Supplier) instead. |
default <L> Either<L,T> |
Value.toRight(L left)
Deprecated.
Use
Value.toEither(Object) instead. |
default <L> Either<L,T> |
Value.toRight(Supplier<? extends L> left)
Deprecated.
Use
Value.toEither(Supplier) instead. |
Modifier and Type | Class and Description |
---|---|
static class |
Either.Left<L,R>
The
Left version of an Either . |
static class |
Either.Right<L,R>
The
Right version of an Either . |
Modifier and Type | Method and Description |
---|---|
default <X,Y> Either<X,Y> |
Either.bimap(Function<? super L,? extends X> leftMapper,
Function<? super R,? extends Y> rightMapper)
Maps either the left or the right side of this disjunction.
|
default Either<L,R> |
Either.filterOrElse(Predicate<? super R> predicate,
Function<? super R,? extends L> zero)
Filters this right-biased
Either by testing a predicate. |
default <U> Either<L,U> |
Either.flatMap(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 a
Either.Left |
default <U> Either<L,U> |
Either.map(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(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 widened
Either<? extends L, ? extends R> to Either<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(Supplier<? extends Either<? extends L,? extends R>> supplier) |
default Either<L,R> |
Either.peek(Consumer<? super R> action) |
default Either<L,R> |
Either.peekLeft(Consumer<? super L> action) |
static <L,R> Either<L,R> |
Either.right(R right)
Constructs a
Either.Right |
static <L,R> Either<Seq<L>,Seq<R>> |
Either.sequence(Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces many
Either s into a single Either by transforming an
Iterable<Either<L, R>> into a Either<Seq<L>, Seq<R>> . |
static <L,R> Either<L,Seq<R>> |
Either.sequenceRight(Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces many
Either s into a single Either by transforming an
Iterable<Either<L, R>> into a Either<L, Seq<R>> . |
default Either<R,L> |
Either.swap()
Converts a
Left to a Right vice versa by wrapping the value in a new type. |
default Either<E,T> |
Validation.toEither()
Converts this Validation to an
Either . |
default Either<Throwable,T> |
Try.toEither()
Converts this
Try to an Either . |
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.
|
static <L,R,T> Either<Seq<L>,Seq<R>> |
Either.traverse(Iterable<? extends T> values,
Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a single
Either by
transforming an Iterable<? extends T> into a Either<Seq<U>> . |
static <L,R,T> Either<L,Seq<R>> |
Either.traverseRight(Iterable<? extends T> values,
Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a single
Either by
transforming an Iterable<? extends T> into a Either<Seq<U>> . |
Modifier and Type | Method and Description |
---|---|
default Option<Either<L,R>> |
Either.filter(Predicate<? super R> predicate)
Filters this right-biased
Either by testing a predicate. |
Modifier and Type | Method and Description |
---|---|
static <E,T> Validation<E,T> |
Validation.fromEither(Either<E,T> either)
Creates a
Validation of an Either . |
static <L,R> Either<L,R> |
Either.narrow(Either<? extends L,? extends R> either)
Narrows a widened
Either<? extends L, ? extends R> to Either<L, R>
by performing a type-safe cast. |
default Either<L,R> |
Either.orElse(Either<? extends L,? extends R> other) |
Modifier and Type | Method and Description |
---|---|
default <U> Either<L,U> |
Either.flatMap(Function<? super R,? extends Either<L,? extends U>> mapper)
FlatMaps this right-biased Either.
|
default Either<L,R> |
Either.orElse(Supplier<? extends Either<? extends L,? extends R>> supplier) |
static <L,R> Either<Seq<L>,Seq<R>> |
Either.sequence(Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces many
Either s into a single Either by transforming an
Iterable<Either<L, R>> into a Either<Seq<L>, Seq<R>> . |
static <L,R> Either<L,Seq<R>> |
Either.sequenceRight(Iterable<? extends Either<? extends L,? extends R>> eithers)
Reduces many
Either s into a single Either by transforming an
Iterable<Either<L, R>> into a Either<L, Seq<R>> . |
static <L,R,T> Either<Seq<L>,Seq<R>> |
Either.traverse(Iterable<? extends T> values,
Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a single
Either by
transforming an Iterable<? extends T> into a Either<Seq<U>> . |
static <L,R,T> Either<L,Seq<R>> |
Either.traverseRight(Iterable<? extends T> values,
Function<? super T,? extends Either<? extends L,? extends R>> mapper)
Maps the values of an iterable to a sequence of mapped values into a single
Either by
transforming an Iterable<? extends T> into a Either<Seq<U>> . |
Copyright © 2020. All Rights Reserved.