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 return the user's callback, unchanged.

Decorators must not transform a user callback into null.

  • Method Details

    • decorate

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

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

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

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

      default <V> Callable<V> decorate(Callable<V> callable)
      Allows decorating a Callable.
      Type Parameters:
      V - the callable return type
      Parameters:
      callable - the callable
      Returns:
      the decorated callable
    • decorate

      default <T1, T2> BiConsumer<T1,T2> decorate(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> Function<I,O> decorate(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> BiFunction<I1,I2,O> decorate(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> BinaryOperator<T> decorate(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 BooleanSupplier decorate(BooleanSupplier supplier)
      Allows decorating a BooleanSupplier.
      Parameters:
      supplier - the supplier
      Returns:
      the decorated boolean supplier
    • decorate

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