Interface CallbackDecorator

  • All Superinterfaces:
    MutinyInterceptor

    public interface CallbackDecorator
    extends MutinyInterceptor
    Intercept user callbacks. Decorators are called when the user passes a callback to Mutiny and so decorators can modify the passed callback.

    The default behavior is to returns the user's callback, unchanged.

    Decorators must not transform a user callback into null.

    • Method Detail

      • decorate

        default <T> java.util.function.Supplier<T> decorate​(java.util.function.Supplier<T> supplier)
        Allows decorating a Supplier.
        Type Parameters:
        T - the produced type
        Parameters:
        supplier - the supplier
        Returns:
        the decorated supplier.
      • decorate

        default <T> java.util.function.Consumer<T> decorate​(java.util.function.Consumer<T> consumer)
        Allows decorating a Consumer.
        Type Parameters:
        T - the consumed type
        Parameters:
        consumer - the consumer
        Returns:
        the decorated consumer.
      • decorate

        default java.util.function.LongConsumer decorate​(java.util.function.LongConsumer consumer)
        Allows decorating a LongConsumer.
        Parameters:
        consumer - the consumer
        Returns:
        the decorated consumer.
      • decorate

        default java.lang.Runnable decorate​(java.lang.Runnable runnable)
        Allows decorating a Runnable.
        Parameters:
        runnable - the runnable
        Returns:
        the decorated runnable
      • decorate

        default <T1,​T2> java.util.function.BiConsumer<T1,​T2> decorate​(java.util.function.BiConsumer<T1,​T2> consumer)
        Allows decorating a BiConsumer.
        Type Parameters:
        T1 - the type of the first parameter
        T2 - the type of the second parameter
        Parameters:
        consumer - the consumer
        Returns:
        the decorated bi-consumer
      • decorate

        default <I,​O> java.util.function.Function<I,​O> decorate​(java.util.function.Function<I,​O> function)
        Allows decorating a Function.
        Type Parameters:
        I - the input type
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​O> Functions.Function3<I1,​I2,​I3,​O> decorate​(Functions.Function3<I1,​I2,​I3,​O> function)
        Allows decorating a Functions.Function3.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​O> Functions.Function4<I1,​I2,​I3,​I4,​O> decorate​(Functions.Function4<I1,​I2,​I3,​I4,​O> function)
        Allows decorating a Functions.Function4.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​I5,​O> Functions.Function5<I1,​I2,​I3,​I4,​I5,​O> decorate​(Functions.Function5<I1,​I2,​I3,​I4,​I5,​O> function)
        Allows decorating a Functions.Function5.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        I5 - the type of the 5th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​I5,​I6,​O> Functions.Function6<I1,​I2,​I3,​I4,​I5,​I6,​O> decorate​(Functions.Function6<I1,​I2,​I3,​I4,​I5,​I6,​O> function)
        Allows decorating a Functions.Function6.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        I5 - the type of the 5th parameter
        I6 - the type of the 6th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​I5,​I6,​I7,​O> Functions.Function7<I1,​I2,​I3,​I4,​I5,​I6,​I7,​O> decorate​(Functions.Function7<I1,​I2,​I3,​I4,​I5,​I6,​I7,​O> function)
        Allows decorating a Functions.Function7.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        I5 - the type of the 5th parameter
        I6 - the type of the 6th parameter
        I7 - the type of the 7th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​O> Functions.Function8<I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​O> decorate​(Functions.Function8<I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​O> function)
        Allows decorating a Functions.Function8.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        I5 - the type of the 5th parameter
        I6 - the type of the 6th parameter
        I7 - the type of the 7th parameter
        I8 - the type of the 8th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​I9,​O> Functions.Function9<I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​I9,​O> decorate​(Functions.Function9<I1,​I2,​I3,​I4,​I5,​I6,​I7,​I8,​I9,​O> function)
        Allows decorating a Functions.Function9.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        I3 - the type of the 3rd parameter
        I4 - the type of the 4th parameter
        I5 - the type of the 5th parameter
        I6 - the type of the 6th parameter
        I7 - the type of the 7th parameter
        I8 - the type of the 8th parameter
        I9 - the type of the 9th parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <I1,​I2,​O> java.util.function.BiFunction<I1,​I2,​O> decorate​(java.util.function.BiFunction<I1,​I2,​O> function)
        Allows decorating a BiFunction.
        Type Parameters:
        I1 - the type of the 1st parameter
        I2 - the type of the 2nd parameter
        O - the output type
        Parameters:
        function - the function
        Returns:
        the decorated function
      • decorate

        default <T> java.util.function.BinaryOperator<T> decorate​(java.util.function.BinaryOperator<T> operator)
        Allows decorating a BinaryOperator.
        Type Parameters:
        T - the type of the parameters
        Parameters:
        operator - the operator
        Returns:
        the decorated binary operator
      • decorate

        default <T1,​T2,​T3> Functions.TriConsumer<T1,​T2,​T3> decorate​(Functions.TriConsumer<T1,​T2,​T3> consumer)
        Allows decorating a Functions.TriConsumer.
        Type Parameters:
        T1 - the type of the 1st parameter
        T2 - the type of the 2nd parameter
        T3 - the type of the 3rd parameter
        Parameters:
        consumer - the consumer
        Returns:
        the decorated consumer
      • decorate

        default java.util.function.BooleanSupplier decorate​(java.util.function.BooleanSupplier supplier)
        Allows decorating a BooleanSupplier.
        Parameters:
        supplier - the supplier
        Returns:
        the decorated boolean supplier
      • decorate

        default <T> java.util.function.Predicate<T> decorate​(java.util.function.Predicate<T> predicate)
        Allows decorating a Predicate.
        Type Parameters:
        T - the type tested by the predicate
        Parameters:
        predicate - the predicate
        Returns:
        the decorated predicate