Package io.vavr
Class API.ForLazy2List<T1,T2>
- java.lang.Object
-
- io.vavr.API.ForLazy2List<T1,T2>
-
- Type Parameters:
T1- the component type of the 1st ListT2- the component type of the 2nd List
- Enclosing class:
- API
public static class API.ForLazy2List<T1,T2> extends java.lang.ObjectA lazily evaluatedFor-comprehension with two Lists.Constructed via
For(...)and evaluated by callingyield(...). Construction is side-effect free; underlying Lists are traversed only whenyield(...)is invoked.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> List<R>yield(@NonNull java.util.function.BiFunction<? super T1,? super T2,? extends R> f)Produces results by mapping the Cartesian product of all bound values.
-
-
-
Method Detail
-
yield
public <R> List<R> yield(@NonNull java.util.function.BiFunction<? super T1,? super T2,? extends R> f)
Produces results by mapping the Cartesian product of all bound values.Evaluation is lazy and delegated to the underlying Lists by composing
flatMapandmapchains.- Type Parameters:
R- the element type of the resultingList- Parameters:
f- a function mapping a tuple of bound values to a result- Returns:
- an
Listcontaining mapped results - Throws:
java.lang.NullPointerException- iffisnull
-
-