Package io.vavr

Class API.ForLazy6Future<T1,​T2,​T3,​T4,​T5,​T6>

  • Type Parameters:
    T1 - the component type of the 1st Future
    T2 - the component type of the 2nd Future
    T3 - the component type of the 3rd Future
    T4 - the component type of the 4th Future
    T5 - the component type of the 5th Future
    T6 - the component type of the 6th Future
    Enclosing class:
    API

    public static class API.ForLazy6Future<T1,​T2,​T3,​T4,​T5,​T6>
    extends java.lang.Object
    A lazily evaluated For-comprehension with 6 Futures.

    Constructed via For(...) and evaluated by calling yield(...). Construction is side-effect free; underlying Futures are traversed only when yield(...) is invoked.

    • Method Detail

      • yield

        public <R> Future<R> yield​(@NonNull Function6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? extends R> f)
        Produces results by mapping the Cartesian product of all bound values.

        Evaluation is lazy and delegated to the underlying Futures by composing flatMap and map chains.

        Type Parameters:
        R - the element type of the resulting Future
        Parameters:
        f - a function mapping a tuple of bound values to a result
        Returns:
        an Future containing mapped results
        Throws:
        java.lang.NullPointerException - if f is null