Package | Description |
---|---|
javaslang | |
javaslang.control |
Modifier and Type | Method and Description |
---|---|
default <R> Either<T,R> |
Value.toLeft(R right)
Converts this value to a
Either . |
default <R> Either<T,R> |
Value.toLeft(java.util.function.Supplier<? extends R> right)
Converts this value to a
Either . |
default <L> Either<L,T> |
Value.toRight(L left)
Converts this value to a
Either . |
default <L> Either<L,T> |
Value.toRight(java.util.function.Supplier<? extends L> left)
Converts this value 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(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 <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 a
Either.Left |
default <U> Either<L,U> |
Either.map(java.util.function.Function<? super R,? extends U> mapper)
Maps this right-biased Either.
|
default <U> Either<U,R> |
Either.mapLeft(java.util.function.Function<? super L,? extends U> leftMapper)
Maps this right-biased Either.
|
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) |
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(java.util.function.Predicate<? super R> predicate)
Filters this right-biased
Either by testing a predicate. |
default Match.MatchValue.Of<Either<L,R>> |
Either.match() |
Modifier and Type | Method and Description |
---|---|
static <E,T> Validation<E,T> |
Validation.fromEither(Either<E,T> either)
Creates a
Validation of an Either . |
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(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) |
Copyright © 2016. All Rights Reserved.