Package io.vavr
Class API.ForLazy2Validation<L,T1,T2>
- java.lang.Object
-
- io.vavr.API.ForLazy2Validation<L,T1,T2>
-
- Type Parameters:
L- the common left-hand type of all ValidationsT1- the component type of the 1st ValidationT2- the component type of the 2nd Validation
- Enclosing class:
- API
public static class API.ForLazy2Validation<L,T1,T2> extends java.lang.ObjectA lazily evaluatedFor-comprehension with two Validations.Constructed via
For(...)and evaluated by callingyield(...). Construction is side-effect free; underlying Validations are traversed only whenyield(...)is invoked.
-
-
Field Summary
Fields Modifier and Type Field Description private Validation<L,T1>ts1private Function1<? super T1,Validation<L,T2>>ts2
-
Constructor Summary
Constructors Modifier Constructor Description privateForLazy2Validation(Validation<L,T1> ts1, Function1<? super T1,Validation<L,T2>> ts2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Validation<L,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.
-
-
-
Field Detail
-
ts1
private final Validation<L,T1> ts1
-
ts2
private final Function1<? super T1,Validation<L,T2>> ts2
-
-
Constructor Detail
-
ForLazy2Validation
private ForLazy2Validation(Validation<L,T1> ts1, Function1<? super T1,Validation<L,T2>> ts2)
-
-
Method Detail
-
yield
public <R> Validation<L,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 Validations by composing
flatMapandmapchains.- Type Parameters:
R- the element type of the resultingValidation- Parameters:
f- a function mapping a tuple of bound values to a result- Returns:
- an
Validationcontaining mapped results - Throws:
java.lang.NullPointerException- iffisnull
-
-