| Package | Description |
|---|---|
| io.atlassian.fugue |
| Modifier and Type | Method and Description |
|---|---|
<X> Either<X,R> |
Either.LeftProjection.ap(Either<Function<L,X>,R> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.ap(Either<L,Function<R,X>> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.RightProjection.ap(Either<L,Function<R,X>> either)
Function application on this projection's value.
|
<X> Either<X,R> |
Either.LeftProjection.apply(Either<Function<L,X>,R> either)
Deprecated.
since 3.0
|
<X> Either<L,X> |
Either.apply(Either<L,Function<R,X>> either)
Deprecated.
|
<X> Either<L,X> |
Either.RightProjection.apply(Either<L,Function<R,X>> either)
Deprecated.
since 3.0 see ap
|
abstract <LL,RR> Either<LL,RR> |
Either.bimap(Function<? super L,? extends LL> ifLeft,
Function<? super R,? extends RR> ifRight)
Map the given functions across the appropriate side.
|
static <L,R> Either<L,R> |
Eithers.cond(boolean predicate,
L left,
R right)
Creates an Either based on a boolean expression.
|
Either<L,R> |
Either.Projection.either()
The either value underlying this projection.
|
Either<L,R> |
Either.LeftProjection.filterOrElse(Predicate<? super L> p,
Supplier<? extends R> orElseSupplier)
Return a
Left if this is a Left and the
contained values satisfies the given predicate. |
Either<L,R> |
Either.filterOrElse(Predicate<? super R> p,
Supplier<? extends L> orElseSupplier)
Return a
Right if this is a Right and the
contained values satisfies the given predicate. |
Either<L,R> |
Either.RightProjection.filterOrElse(Predicate<? super R> p,
Supplier<? extends L> orElseSupplier)
Return a
Right if this is a Right and the
contained values satisfies the given predicate. |
<X,RR extends R> |
Either.LeftProjection.flatMap(Function<? super L,Either<X,RR>> f)
Binds the given function across this projection's value if it has one.
|
<X,LL extends L> |
Either.flatMap(Function<? super R,Either<LL,X>> f)
Binds the given function across the right hand side value if it is one.
|
<X,LL extends L> |
Either.RightProjection.flatMap(Function<? super R,Either<LL,X>> f)
Binds the given function across this projection's value if it has one.
|
static <L,R> Either<L,R> |
Either.left(L left)
left.
|
<X> Either<X,R> |
Either.leftMap(Function<? super L,X> f)
Map the given function across the left hand side value if it is one.
|
<X> Either<X,R> |
Either.LeftProjection.map(Function<? super L,X> f)
Map the given function across this projection's value if it has one.
|
<X> Either<L,X> |
Either.map(Function<? super R,X> f)
Map the given function across the right hand side value if it is one.
|
<X> Either<L,X> |
Either.RightProjection.map(Function<? super R,X> f)
Map the given function across this projection's value if it has one.
|
Either<L,R> |
Either.orElse(Either<? extends L,? extends R> orElse)
If this is a right, return the same right.
|
Either<L,R> |
Either.orElse(Supplier<? extends Either<? extends L,? extends R>> orElse)
If this is a right, return the same right.
|
static <L,R> Either<L,R> |
Either.right(R right)
right.
|
<X> Either<L,X> |
Either.sequence(Either<L,X> e)
Will return the supplied Either if this one is right, otherwise this one if
left.
|
<X> Either<L,X> |
Either.RightProjection.sequence(Either<L,X> e)
Anonymous bind through this projection.
|
<X> Either<X,R> |
Either.LeftProjection.sequence(Either<X,R> e)
Anonymous bind through this projection.
|
static <L,R> Either<Iterable<L>,R> |
Eithers.sequenceLeft(Iterable<Either<L,R>> eithers)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R,A,C> Either<C,R> |
Eithers.sequenceLeft(Iterable<Either<L,R>> eithers,
Collector<L,A,C> collector)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R> Either<L,Iterable<R>> |
Eithers.sequenceRight(Iterable<Either<L,R>> eithers)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R,A,C> Either<L,C> |
Eithers.sequenceRight(Iterable<Either<L,R>> eithers,
Collector<R,A,C> collector)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
abstract Either<R,L> |
Either.swap()
If this is a left, then return the left value in right, or vice versa.
|
abstract Either<Exception,A> |
Try.toEither()
Convert this Try to an
Either, becoming a left if this is a failure
and a right if this is a success. |
<X> Either<A,X> |
Option.toLeft(Supplier<X> right)
Creates an Either from this Option.
|
<X> Either<X,A> |
Option.toRight(Supplier<X> left)
Creates an Either from this Option.
|
static <LL,L extends LL,R> |
Eithers.upcastLeft(Either<L,R> e)
Upcasts an
either of left type L to an either of left type
LL, which is a super type of L, keeping the right type unchanged. |
static <L,RR,R extends RR> |
Eithers.upcastRight(Either<L,R> e)
Upcasts an
either of right type R to an either of right type
RR, which is a super type of R, keeping the left type unchanged. |
| Modifier and Type | Method and Description |
|---|---|
static <L,R> Monoid<Either<L,R>> |
Monoids.either(Semigroup<L> lS,
Monoid<R> rM)
A monoid Sums up values inside either
Semigroups.either(io.atlassian.fugue.Semigroup<L>, io.atlassian.fugue.Semigroup<R>). |
static <L,R> Semigroup<Either<L,R>> |
Semigroups.either(Semigroup<L> lS,
Semigroup<R> rS)
Sums up values inside either, if both are left or right.
|
<X> Option<Either<L,X>> |
Either.LeftProjection.filter(Predicate<? super L> f)
Returns
None if this projection has no value or if the given
predicate p does not hold for the value, otherwise, returns
a left in Some. |
Option<Either<L,R>> |
Either.filter(Predicate<? super R> p)
Returns
None if this is a left or if the given predicate
p does not hold for the contained value, otherwise, returns a
right in Some. |
<X> Option<Either<X,R>> |
Either.RightProjection.filter(Predicate<? super R> f)
Returns
None if this projection has no value or if the given
predicate p does not hold for the value, otherwise, returns
a right in Some. |
static <L,R> Predicate<Either<L,R>> |
Eithers.isLeft()
A predicate that tests if the supplied either is a left.
|
static <L,R> Predicate<Either<L,R>> |
Eithers.isRight()
A predicate that tests if the supplied either is a right.
|
static <L,R> Function<Either<L,R>,Option<L>> |
Eithers.leftMapper()
A function that maps an either to an option of its left type.
|
static <L,R> Function<Either<L,R>,Option<R>> |
Eithers.rightMapper()
A function that maps an either to an option of its right type.
|
static <L,R> Collector<Either<L,R>,?,Either<List<L>,R>> |
FugueCollectors.toEitherLeft()
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R> Collector<Either<L,R>,?,Either<List<L>,R>> |
FugueCollectors.toEitherLeft()
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R,A,B> Collector<Either<L,R>,?,Either<B,R>> |
FugueCollectors.toEitherLeft(Collector<L,A,B> lCollector)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R,A,B> Collector<Either<L,R>,?,Either<B,R>> |
FugueCollectors.toEitherLeft(Collector<L,A,B> lCollector)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R> Collector<Either<L,R>,?,Either<L,List<R>>> |
FugueCollectors.toEitherRight()
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R> Collector<Either<L,R>,?,Either<L,List<R>>> |
FugueCollectors.toEitherRight()
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R,A,B> Collector<Either<L,R>,?,Either<L,B>> |
FugueCollectors.toEitherRight(Collector<R,A,B> rCollector)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R,A,B> Collector<Either<L,R>,?,Either<L,B>> |
FugueCollectors.toEitherRight(Collector<R,A,B> rCollector)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R> Function<L,Either<L,R>> |
Eithers.toLeft()
Function to convert from an value to a
Either.Left containing that value. |
static <L,R> Function<L,Either<L,R>> |
Eithers.toLeft(Class<L> leftType,
Class<R> rightType)
Function to convert from a value to a
Either.Left containing that value. |
static <L,R> Supplier<Either<L,R>> |
Eithers.toLeft(L l)
Supplier returning a
Either.Left. |
static <L,R> Supplier<Either<L,R>> |
Eithers.toLeft(L l,
Class<R> rightType)
Supplier returning a
Either.Left. |
static <L,R> Function<R,Either<L,R>> |
Eithers.toRight()
Function to convert from an value to a
Either.Right. |
static <L,R> Function<R,Either<L,R>> |
Eithers.toRight(Class<L> leftType,
Class<R> rightType)
Function to convert from a value to a
Either.Right containing that value. |
static <L,R> Supplier<Either<L,R>> |
Eithers.toRight(Class<L> leftType,
R r)
Supplier returning a
Either.Right. |
static <L,R> Supplier<Either<L,R>> |
Eithers.toRight(R r)
Supplier returning a
Either.Right. |
| Modifier and Type | Method and Description |
|---|---|
<X> Either<X,R> |
Either.LeftProjection.ap(Either<Function<L,X>,R> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.ap(Either<L,Function<R,X>> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.RightProjection.ap(Either<L,Function<R,X>> either)
Function application on this projection's value.
|
<X> Either<X,R> |
Either.LeftProjection.apply(Either<Function<L,X>,R> either)
Deprecated.
since 3.0
|
<X> Either<L,X> |
Either.apply(Either<L,Function<R,X>> either)
Deprecated.
|
<X> Either<L,X> |
Either.RightProjection.apply(Either<L,Function<R,X>> either)
Deprecated.
since 3.0 see ap
|
static <X extends Exception,A> |
Eithers.getOrThrow(Either<X,A> either)
Simplifies extracting a value or throwing a checked exception from an
Either.
|
static <T> T |
Eithers.merge(Either<T,T> either)
Extracts an object from an Either, regardless of the side in which it is
stored, provided both sides contain the same type.
|
Either<L,R> |
Either.orElse(Either<? extends L,? extends R> orElse)
If this is a right, return the same right.
|
<X> Either<L,X> |
Either.sequence(Either<L,X> e)
Will return the supplied Either if this one is right, otherwise this one if
left.
|
<X> Either<L,X> |
Either.RightProjection.sequence(Either<L,X> e)
Anonymous bind through this projection.
|
<X> Either<X,R> |
Either.LeftProjection.sequence(Either<X,R> e)
Anonymous bind through this projection.
|
static <LL,L extends LL,R> |
Eithers.upcastLeft(Either<L,R> e)
Upcasts an
either of left type L to an either of left type
LL, which is a super type of L, keeping the right type unchanged. |
static <L,RR,R extends RR> |
Eithers.upcastRight(Either<L,R> e)
Upcasts an
either of right type R to an either of right type
RR, which is a super type of R, keeping the left type unchanged. |
| Modifier and Type | Method and Description |
|---|---|
static <L,R> Iterable<L> |
Eithers.filterLeft(Iterable<Either<L,R>> it)
|
static <L,R> Iterable<R> |
Eithers.filterRight(Iterable<Either<L,R>> it)
|
<X,RR extends R> |
Either.LeftProjection.flatMap(Function<? super L,Either<X,RR>> f)
Binds the given function across this projection's value if it has one.
|
<X,LL extends L> |
Either.flatMap(Function<? super R,Either<LL,X>> f)
Binds the given function across the right hand side value if it is one.
|
<X,LL extends L> |
Either.RightProjection.flatMap(Function<? super R,Either<LL,X>> f)
Binds the given function across this projection's value if it has one.
|
Either<L,R> |
Either.orElse(Supplier<? extends Either<? extends L,? extends R>> orElse)
If this is a right, return the same right.
|
static <L,R> Either<Iterable<L>,R> |
Eithers.sequenceLeft(Iterable<Either<L,R>> eithers)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R,A,C> Either<C,R> |
Eithers.sequenceLeft(Iterable<Either<L,R>> eithers,
Collector<L,A,C> collector)
Collect the left values if there are only lefts, otherwise return the first
right encountered.
|
static <L,R> Either<L,Iterable<R>> |
Eithers.sequenceRight(Iterable<Either<L,R>> eithers)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
static <L,R,A,C> Either<L,C> |
Eithers.sequenceRight(Iterable<Either<L,R>> eithers,
Collector<R,A,C> collector)
Collect the right values if there are only rights, otherwise return the
first left encountered.
|
Copyright © 2018 Atlassian. All rights reserved.