Class EitherStep6<A,​B,​C,​D,​E,​F,​LEFT>

  • Type Parameters:
    A - The right hand side type of the first defined right value
    B - The right hand side type of the second defined right value
    C - The right hand side type of the third defined right value
    D - The right hand side type of the fourth defined right value
    E - The right hand side type of the fifth defined right value
    F - The right hand side type of the sixth defined right value
    LEFT - The left hand side type of the Either result

    public final class EitherStep6<A,​B,​C,​D,​E,​F,​LEFT>
    extends java.lang.Object
    The sixth step of the Either type.

    This class is not intended to be contructed manually, and should only be used as part of a Steps chain, started by Steps.begin(Either)

    Since:
    4.7.0
    See Also:
    for usage examples, Either
    • Method Detail

      • filter

        public EitherStep6<A,​B,​C,​D,​E,​F,​LEFT> filter​(Predicate6<? super A,​? super B,​? super C,​? super D,​? super E,​? super F> predicate,
                                                                                        java.util.function.Supplier<? extends LEFT> unsatisfiedSupplier)
        Apply the provided predicate with the previous step results.

        If the predicate is not satisfied then the unsatisfiedSupplier is used to populate the left value that will prevent any further steps evaluation.

        Parameters:
        predicate - The check that must be satisfied by contained values
        unsatisfiedSupplier - Provide the value to populate the left if not satisfied
        Returns:
        This step class with either the same last step value, or changed to a left
      • yield

        public <Z> Either<LEFT,​Z> yield​(Function6<? super A,​? super B,​? super C,​? super D,​? super E,​? super F,​Z> functor)
        Terminating step expression, that will provide the previous steps to this function and return the result as a Right
        Type Parameters:
        Z - The right hand side type for the returned result
        Parameters:
        functor - The yield function to map on previous values
        Returns:
        An Either with the result of this function on right, or the existing left