Package io.vavr
Class API.ForLazy2Option<T1,T2>
java.lang.Object
io.vavr.API.ForLazy2Option<T1,T2>
- Type Parameters:
T1- the component type of the 1st OptionT2- the component type of the 2nd Option
- Enclosing class:
API
A lazily evaluated
For-comprehension with two Options.
Constructed via For(...) and evaluated by calling yield(...).
Construction is side-effect free; underlying Options are traversed
only when yield(...) is invoked.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Option<R> yield(@NonNull BiFunction<? super T1, ? super T2, ? extends R> f) Produces results by mapping the Cartesian product of all bound values.
-
Field Details
-
ts1
-
ts2
-
-
Constructor Details
-
ForLazy2Option
-
-
Method Details
-
yield
Produces results by mapping the Cartesian product of all bound values.Evaluation is lazy and delegated to the underlying Options by composing
flatMapandmapchains.- Type Parameters:
R- the element type of the resultingOption- Parameters:
f- a function mapping a tuple of bound values to a result- Returns:
- an
Optioncontaining mapped results - Throws:
NullPointerException- iffisnull
-