Package | Description |
---|---|
javaslang | |
javaslang.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)
Converts this to a
Either . |
default <R> Either<T,R> |
Value.toLeft(Supplier<? extends R> right)
Converts this to a
Either . |
default <L> Either<L,T> |
Value.toRight(L left)
Converts this to a
Either . |
default <L> Either<L,T> |
Value.toRight(Supplier<? extends L> left)
Converts this to a
Either . |
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 <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 |
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()
Returns this as
Either . |
default Either<Throwable,T> |
Try.toEither()
Converts this
Try to an Either . |
Either<L,R> |
Either.LeftProjection.toEither()
Returns the underlying either of this projection.
|
Either<L,R> |
Either.RightProjection.toEither()
Returns the underlying either of this projection.
|
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) |
Copyright © 2016. All Rights Reserved.