Package ratpack.func

Interface Function.ConditionalSpec<I,​O>

  • Type Parameters:
    I - the input type
    O - the output type
    Enclosing interface:
    Function<I,​O>

    public static interface Function.ConditionalSpec<I,​O>
    A spec for adding conditions to a conditional function.
    Since:
    1.5
    See Also:
    Function.conditional(Function, Action)
    • Method Detail

      • when

        Function.ConditionalSpec<I,​O> when​(Predicate<? super I> predicate,
                                                 Function<? super I,​? extends O> function)
        Adds a conditional function.
        Parameters:
        predicate - the condition predicate
        function - the function to apply if the predicate applies
        Returns:
        this