Class EitherStep5<A,B,C,D,E,LEFT>
- java.lang.Object
-
- io.atlassian.fugue.extensions.step.EitherStep5<A,B,C,D,E,LEFT>
-
- Type Parameters:
A- The right hand side type of the first defined right valueB- The right hand side type of the second defined right valueC- The right hand side type of the third defined right valueD- The right hand side type of the fourth defined right valueE- The right hand side type of the fifth defined right valueLEFT- The left hand side type of the Either result
public final class EitherStep5<A,B,C,D,E,LEFT> extends java.lang.ObjectThe fifth step of theEithertype.This class is not intended to be contructed manually, and should only be used as part of a
Stepschain, started bySteps.begin(Either)- Since:
- 4.7.0
- See Also:
for usage examples,Either
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EitherStep5<A,B,C,D,E,LEFT>filter(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate, java.util.function.Supplier<? extends LEFT> unsatisfiedSupplier)Apply the provided predicate with the previous step results.<F,LL extends LEFT>
EitherStep6<A,B,C,D,E,F,LEFT>then(Function5<? super A,? super B,? super C,? super D,? super E,Either<LL,F>> functor)Apply the provided function with the previous Step results.<F,LL extends LEFT>
EitherStep6<A,B,C,D,E,F,LEFT>then(java.util.function.Supplier<Either<LL,F>> supplier)Apply the provided supplier with the previous Step results.<Z> Either<LEFT,Z>yield(Function5<? super A,? super B,? super C,? super D,? super E,Z> functor)Terminating step expression, that will provide the previous steps to this function and return the result as aRight
-
-
-
Method Detail
-
then
public <F,LL extends LEFT> EitherStep6<A,B,C,D,E,F,LEFT> then(Function5<? super A,? super B,? super C,? super D,? super E,Either<LL,F>> functor)
Apply the provided function with the previous Step results.Internally this will perform a
Either.flatMap(Function)and the result will become the next step value.- Type Parameters:
F- The right hand side type of the next step resultLL- The left hand side type of the result that must be related toEitherStep5- Parameters:
functor- The functor to be applied as a flatMap with the previous steps- Returns:
- The next step class
-
then
public <F,LL extends LEFT> EitherStep6<A,B,C,D,E,F,LEFT> then(java.util.function.Supplier<Either<LL,F>> supplier)
Apply the provided supplier with the previous Step results.Internally this will perform a
Either.flatMap(Function)and the supplier will become the next step value.This is different to
then(Function5)in that the previous step results are not provided for the new step evaluation.- Type Parameters:
F- The right hand side type of the next step resultLL- The left hand side type of the result that must be related toEitherStep5- Parameters:
supplier- The supplier to provide the result of the flatMap with the previous step.- Returns:
- The next step class
-
filter
public EitherStep5<A,B,C,D,E,LEFT> filter(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate, java.util.function.Supplier<? extends LEFT> unsatisfiedSupplier)
Apply the provided predicate with the previous step results.If the predicate is not satisfied then the unsatisfiedSupplier is used to populate the left value that will prevent any further steps evaluation.
- Parameters:
predicate- The check that must be satisfied by contained valuesunsatisfiedSupplier- Provide the value to populate the left if not satisfied- Returns:
- This step class with either the same last step value, or changed to a left
-
yield
public <Z> Either<LEFT,Z> yield(Function5<? super A,? super B,? super C,? super D,? super E,Z> functor)
Terminating step expression, that will provide the previous steps to this function and return the result as aRight- Type Parameters:
Z- The right hand side type for the returned result- Parameters:
functor- The yield function to map on previous values- Returns:
- An Either with the result of this function on right, or the existing left
-
-