Class OptionStep5<A,B,C,D,E>
- java.lang.Object
-
- io.atlassian.fugue.extensions.step.OptionStep5<A,B,C,D,E>
-
- Type Parameters:
A- The type of the first defined valueB- The type of the second defined valueC- The type of the third defined valueD- The type of the fourth defined valueE- The type of the fifth defined value
public final class OptionStep5<A,B,C,D,E> extends java.lang.ObjectThe fifth step of theOptiontype.This class is not intended to be contructed manually, and should only be used as part of a
Stepschain, started bySteps.begin(Option)- Since:
- 4.7.0
- See Also:
for usage examples,Option
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OptionStep5<A,B,C,D,E>filter(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate)Apply the provided predicate with the previous step results.OptionStep5<A,B,C,D,E>filterNot(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate)Apply the provided predicate with the previous step results.<F> OptionStep6<A,B,C,D,E,F>then(Function5<? super A,? super B,? super C,? super D,? super E,? extends Option<? extends F>> functor)Apply the provided function with the previous Step results.<F> OptionStep6<A,B,C,D,E,F>then(java.util.function.Supplier<? extends Option<? extends F>> supplier)Apply the provided supplier with the previous Step results.<Z> Option<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 asome
-
-
-
Method Detail
-
then
public <F> OptionStep6<A,B,C,D,E,F> then(Function5<? super A,? super B,? super C,? super D,? super E,? extends Option<? extends F>> 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:
F- 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
public <F> OptionStep6<A,B,C,D,E,F> then(java.util.function.Supplier<? extends Option<? extends F>> supplier)
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(Function5)in that the previous step results are not provided for the new step evaluation.- Type Parameters:
F- 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
public OptionStep5<A,B,C,D,E> filter(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate)
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
public OptionStep5<A,B,C,D,E> filterNot(Predicate5<? super A,? super B,? super C,? super D,? super E> predicate)
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
public <Z> Option<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 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
-
-