Class EitherStep1<A,LEFT>
java.lang.Object
io.atlassian.fugue.extensions.step.EitherStep1<A,LEFT>
- Type Parameters:
A- The right hand side type of the first defined right valueLEFT- The left hand side type of the Either result
The first step of the
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)
- Since:
- 4.7.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApply the provided predicate with the previous step results.<B, LL extends LEFT>
EitherStep2<A, B, LEFT> Apply the provided function with the previous Step results.<B, LL extends LEFT>
EitherStep2<A, B, LEFT> Apply the provided supplier with the previous Step results.Terminating step expression, that will provide the previous steps to this function and return the result as aRight
-
Field Details
-
either1
-
-
Constructor Details
-
EitherStep1
-
-
Method Details
-
then
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:
B- The right hand side type of the next step resultLL- The left hand side type of the result that must be related toLEFT- Parameters:
functor- The functor to be applied as a flatMap with the previous step- Returns:
- The next step class
-
then
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(Function)in that the previous step results are not provided for the new step evaluation.- Type Parameters:
B- The right hand side type of the next step resultLL- The left hand side type of the result that must be related toLEFT- Parameters:
supplier- The supplier to provide the result of the flatMap with the previous step.- Returns:
- The next step class
-
filter
public EitherStep1<A,LEFT> filter(Predicate<? super A> predicate, 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
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
-