Package | Description |
---|---|
com.atlassian.fugue |
Modifier and Type | Method and Description |
---|---|
<X> Either<X,R> |
Either.LeftProjection.apply(Either<com.google.common.base.Function<L,X>,R> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.RightProjection.apply(Either<L,com.google.common.base.Function<R,X>> either)
Function application on this projection's value.
|
abstract <LL,RR> Either<LL,RR> |
Either.bimap(com.google.common.base.Function<? super L,? extends LL> ifLeft,
com.google.common.base.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.
|
static <L,R> Either<L,R> |
Either.cond(boolean predicate,
R right,
L left)
Deprecated.
in 1.2 use
Eithers.cond(boolean, Object, Object) |
Either<L,R> |
Either.Projection.either()
The either value underlying this projection.
|
<X,RR extends R> |
Either.LeftProjection.flatMap(com.google.common.base.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(com.google.common.base.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(com.google.common.base.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) |
<X> Either<X,R> |
Either.leftMap(com.google.common.base.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(com.google.common.base.Function<? super L,X> f)
Map the given function across this projection's value if it has one.
|
<X> Either<L,X> |
Either.map(com.google.common.base.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(com.google.common.base.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(com.google.common.base.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) |
<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> |
Either.sequenceLeft(Iterable<Either<L,R>> eithers)
Deprecated.
in 1.2 use
Eithers.sequenceLeft(Iterable) |
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> Either<L,Iterable<R>> |
Either.sequenceRight(Iterable<Either<L,R>> eithers)
Deprecated.
in 1.2 use
Eithers.sequenceRight(Iterable) |
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.
|
abstract Either<R,L> |
Either.swap()
If this is a left, then return the left value in right, or vice versa.
|
<X> Either<A,X> |
Option.toLeft(com.google.common.base.Supplier<X> right)
Creates an Either from this Option.
|
<X> Either<X,A> |
Option.toRight(com.google.common.base.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 |
---|---|
<X> Option<Either<L,X>> |
Either.LeftProjection.filter(com.google.common.base.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(com.google.common.base.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(com.google.common.base.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> com.google.common.base.Predicate<Either<L,R>> |
Eithers.isLeft()
A predicate that tests if the supplied either is a left.
|
static <L,R> com.google.common.base.Predicate<Either<L,R>> |
Eithers.isRight()
A predicate that tests if the supplied either is a right.
|
static <L,R> com.google.common.base.Function<Either<L,R>,Option<L>> |
Eithers.leftMapper()
A function that maps an either to an option of its left type.
|
static <L,R> com.google.common.base.Function<Either<L,R>,Option<R>> |
Eithers.rightMapper()
A function that maps an either to an option of its right type.
|
static <L,R> com.google.common.base.Function<L,Either<L,R>> |
Eithers.toLeft() |
static <L,R> com.google.common.base.Function<L,Either<L,R>> |
Eithers.toLeft(Class<L> leftType,
Class<R> rightType) |
static <L,R> com.google.common.base.Supplier<Either<L,R>> |
Eithers.toLeft(L l) |
static <L,R> com.google.common.base.Supplier<Either<L,R>> |
Eithers.toLeft(L l,
Class<R> rightType) |
static <L,R> com.google.common.base.Function<R,Either<L,R>> |
Eithers.toRight() |
static <L,R> com.google.common.base.Function<R,Either<L,R>> |
Eithers.toRight(Class<L> leftType,
Class<R> rightType) |
static <L,R> com.google.common.base.Supplier<Either<L,R>> |
Eithers.toRight(Class<L> leftType,
R r) |
static <L,R> com.google.common.base.Supplier<Either<L,R>> |
Eithers.toRight(R r) |
Modifier and Type | Method and Description |
---|---|
<X> Either<X,R> |
Either.LeftProjection.apply(Either<com.google.common.base.Function<L,X>,R> either)
Function application on this projection's value.
|
<X> Either<L,X> |
Either.RightProjection.apply(Either<L,com.google.common.base.Function<R,X>> either)
Function application on this projection's value.
|
static <X extends Exception,A> |
Either.getOrThrow(Either<X,A> either)
Deprecated.
in 1.2 use
Eithers.getOrThrow(Either) |
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 |
Either.merge(Either<T,T> either)
Deprecated.
in 1.2 use
Eithers.merge(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.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(com.google.common.base.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(com.google.common.base.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(com.google.common.base.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(com.google.common.base.Supplier<? extends Either<? extends L,? extends R>> orElse)
If this is a right, return the same right.
|
static <L,R> Either<Iterable<L>,R> |
Either.sequenceLeft(Iterable<Either<L,R>> eithers)
Deprecated.
in 1.2 use
Eithers.sequenceLeft(Iterable) |
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> Either<L,Iterable<R>> |
Either.sequenceRight(Iterable<Either<L,R>> eithers)
Deprecated.
in 1.2 use
Eithers.sequenceRight(Iterable) |
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.
|
Copyright © 2015 Atlassian. All rights reserved.