Class OptionStep2<A,B>
java.lang.Object
io.atlassian.fugue.extensions.step.OptionStep2<A,B>
- Type Parameters:
A- The type of the first defined valueB- The type of the second defined value
The second step of the
Option 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(Option)
- Since:
- 4.7.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter(BiPredicate<? super A, ? super B> predicate) Apply the provided predicate with the previous step results.filterNot(BiPredicate<? super A, ? super B> predicate) Apply the provided predicate with the previous step results.<C> OptionStep3<A, B, C> then(BiFunction<? super A, ? super B, ? extends Option<? extends C>> functor) Apply the provided function with the previous Step results.<C> OptionStep3<A, B, C> Apply the provided supplier with the previous Step results.<Z> Option<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 asome
-
Field Details
-
option1
-
option2
-
-
Constructor Details
-
OptionStep2
-
-
Method Details
-
then
public <C> OptionStep3<A,B, thenC> (BiFunction<? super A, ? super B, ? extends Option<? extends C>> functor) Apply the provided function with the previous Step results.Internally this will perform a
Option.flatMap(Function)and the result will become the next step value.- Type Parameters:
C- The type of the next step result- Parameters:
functor- The functor to be applied as a flatMap with the previous steps- Returns:
- The next step class
-
then
Apply the provided supplier with the previous Step results.Internally this will perform a
Option.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.- Type Parameters:
C- The type of the next step result- Parameters:
supplier- The supplier to provide the result of the flatMap with the previous step.- Returns:
- The next step class
-
filter
Apply the provided predicate with the previous step results.- Parameters:
predicate- The check that must be satisfied by contained values- Returns:
- This step class with either the same last step value, or changed to none
-
filterNot
Apply the provided predicate with the previous step results.- Parameters:
predicate- The check that must be dissatisfied by contained values- Returns:
- This step class with either the same last step value, or changed to none
- Since:
- 6.1
-
yield
Terminating step expression, that will provide the previous steps to this function and return the result as asome- Type Parameters:
Z- The type for the returned result- Parameters:
functor- The yield function to map on previous values- Returns:
- An Option containing this result or none
-