A - The right hand side type of the first defined right valueB - The right hand side type of the second defined right valueLEFT - The left hand side type of the Either resultpublic final class EitherStep2<A,B,LEFT> extends Object
Either type.
This class is not intended to be contructed manually, and should only be used
as part of a Steps chain, started by Steps.begin(Either)
for usage examples,
Either| Modifier and Type | Method and Description |
|---|---|
EitherStep2<A,B,LEFT> |
filter(BiPredicate<? super A,? super B> predicate,
Supplier<? extends LEFT> unsatisfiedSupplier)
Apply the provided predicate with the previous step results.
|
<C,LL extends LEFT> |
then(BiFunction<? super A,? super B,Either<LL,C>> functor)
Apply the provided function with the previous Step results.
|
<C,LL extends LEFT> |
then(Supplier<Either<LL,C>> supplier)
Apply the provided supplier with the previous Step results.
|
<Z> Either<LEFT,Z> |
yield(BiFunction<? super A,? super B,Z> functor)
Terminating step expression, that will provide the previous steps to this
function and return the result as a
Right |
public <C,LL extends LEFT> EitherStep3<A,B,C,LEFT> then(BiFunction<? super A,? super B,Either<LL,C>> functor)
Internally this will perform a Either.flatMap(Function) and the
result will become the next step value.
C - The right hand side type of the next step resultLL - The left hand side type of the result that must be related to
LEFTfunctor - The functor to be applied as a flatMap with the previous
stepspublic <C,LL extends LEFT> EitherStep3<A,B,C,LEFT> then(Supplier<Either<LL,C>> supplier)
Internally this will perform a Either.flatMap(Function) and the
supplier will become the next step value.
This is different to then(BiFunction) in that the previous step
results are not provided for the new step evaluation.
C - The right hand side type of the next step resultLL - The left hand side type of the result that must be related to
LEFTsupplier - The supplier to provide the result of the flatMap with the
previous step.public EitherStep2<A,B,LEFT> filter(BiPredicate<? super A,? super B> predicate, Supplier<? extends LEFT> unsatisfiedSupplier)
If the predicate is not satisfied then the unsatisfiedSupplier is used to populate the left value that will prevent any further steps evaluation.
predicate - The check that must be satisfied by contained valuesunsatisfiedSupplier - Provide the value to populate the left if not
satisfiedpublic <Z> Either<LEFT,Z> yield(BiFunction<? super A,? super B,Z> functor)
RightZ - The right hand side type for the returned resultfunctor - The yield function to map on previous valuesCopyright © 2018 Atlassian. All rights reserved.