Interface Contextualizer


public interface Contextualizer
Facility for creating contextual tasks.
Author:
Paul Ferraro
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Contextualizer
     
  • Method Summary

    Modifier and Type
    Method
    Description
    composite(List<Contextualizer> contextualizers)
     
    Decorates the specified runner with a given context.
    <T> Callable<T>
    Decorates the specified caller with a given context.
    <V1, V2> BiConsumer<V1,V2>
    contextualize(BiConsumer<V1,V2> consumer)
    Decorates the specified consumer with a given context.
    <V1, V2, R> BiFunction<V1,V2,R>
    contextualize(BiFunction<V1,V2,R> function)
    Decorates the specified function with a given context.
    <V> Consumer<V>
    contextualize(Consumer<V> consumer)
    Decorates the specified consumer with a given context.
    <V, R> Function<V,R>
    contextualize(Function<V,R> function)
    Decorates the specified function with a given context.
    <T> Supplier<T>
    contextualize(Supplier<T> supplier)
    Decorates the specified supplier with a given context.
    <V1, V2, E extends Exception>
    org.wildfly.common.function.ExceptionBiConsumer<V1,V2,E>
    contextualize(org.wildfly.common.function.ExceptionBiConsumer<V1,V2,E> consumer)
    Decorates the specified consumer with a given context.
    <V1, V2, R, E extends Exception>
    org.wildfly.common.function.ExceptionBiFunction<V1,V2,R,E>
    contextualize(org.wildfly.common.function.ExceptionBiFunction<V1,V2,R,E> function)
    Decorates the specified function with a given context.
    <V, E extends Exception>
    org.wildfly.common.function.ExceptionConsumer<V,E>
    contextualize(org.wildfly.common.function.ExceptionConsumer<V,E> consumer)
    Decorates the specified consumer with a given context.
    <V, R, E extends Exception>
    org.wildfly.common.function.ExceptionFunction<V,R,E>
    contextualize(org.wildfly.common.function.ExceptionFunction<V,R,E> function)
    Decorates the specified function with a given context.
    <E extends Exception>
    org.wildfly.common.function.ExceptionRunnable<E>
    contextualize(org.wildfly.common.function.ExceptionRunnable<E> runner)
    Decorates the specified runner with a given context.
    <T, E extends Exception>
    org.wildfly.common.function.ExceptionSupplier<T,E>
    contextualize(org.wildfly.common.function.ExceptionSupplier<T,E> supplier)
    Decorates the specified supplier with a given context.
     
  • Field Details

  • Method Details

    • contextualize

      Runnable contextualize(Runnable runner)
      Decorates the specified runner with a given context.
      Parameters:
      runner - a runnable task
      Returns:
      a contextual runner
    • contextualize

      <E extends Exception> org.wildfly.common.function.ExceptionRunnable<E> contextualize(org.wildfly.common.function.ExceptionRunnable<E> runner)
      Decorates the specified runner with a given context.
      Type Parameters:
      E - the exception type
      Parameters:
      runner - a runnable task
      Returns:
      a contextual runner
    • contextualize

      <T> Callable<T> contextualize(Callable<T> caller)
      Decorates the specified caller with a given context.
      Type Parameters:
      T - the return type
      Parameters:
      caller - a callable task
      Returns:
      a contextual caller
    • contextualize

      <T> Supplier<T> contextualize(Supplier<T> supplier)
      Decorates the specified supplier with a given context.
      Type Parameters:
      T - the return type
      Parameters:
      supplier - a supplier task
      Returns:
      a contextual supplier
    • contextualize

      <T, E extends Exception> org.wildfly.common.function.ExceptionSupplier<T,E> contextualize(org.wildfly.common.function.ExceptionSupplier<T,E> supplier)
      Decorates the specified supplier with a given context.
      Type Parameters:
      T - the return type
      E - the exception type
      Parameters:
      supplier - a supplier task
      Returns:
      a contextual supplier
    • contextualize

      <V> Consumer<V> contextualize(Consumer<V> consumer)
      Decorates the specified consumer with a given context.
      Type Parameters:
      V - the consumed value type
      Parameters:
      consumer - a consumer
      Returns:
      a contextual consumer
    • contextualize

      <V, E extends Exception> org.wildfly.common.function.ExceptionConsumer<V,E> contextualize(org.wildfly.common.function.ExceptionConsumer<V,E> consumer)
      Decorates the specified consumer with a given context.
      Type Parameters:
      V - the consumed value type
      E - the exception type
      Parameters:
      consumer - a consumer
      Returns:
      a contextual consumer
    • contextualize

      <V1, V2> BiConsumer<V1,V2> contextualize(BiConsumer<V1,V2> consumer)
      Decorates the specified consumer with a given context.
      Type Parameters:
      V1 - the 1st consumed value type
      V2 - the 2nd consumed value type
      Parameters:
      consumer - a consumer
      Returns:
      a contextual consumer
    • contextualize

      <V1, V2, E extends Exception> org.wildfly.common.function.ExceptionBiConsumer<V1,V2,E> contextualize(org.wildfly.common.function.ExceptionBiConsumer<V1,V2,E> consumer)
      Decorates the specified consumer with a given context.
      Type Parameters:
      V1 - the 1st consumed value type
      V2 - the 2nd consumed value type
      E - the exception type
      Parameters:
      consumer - a consumer
      Returns:
      a contextual consumer
    • contextualize

      <V, R> Function<V,R> contextualize(Function<V,R> function)
      Decorates the specified function with a given context.
      Type Parameters:
      V - the function parameter type
      R - the function return type
      Parameters:
      function - a function
      Returns:
      a contextual function
    • contextualize

      <V, R, E extends Exception> org.wildfly.common.function.ExceptionFunction<V,R,E> contextualize(org.wildfly.common.function.ExceptionFunction<V,R,E> function)
      Decorates the specified function with a given context.
      Type Parameters:
      V - the function parameter type
      R - the function return type
      E - the exception type
      Parameters:
      function - a function
      Returns:
      a contextual function
    • contextualize

      <V1, V2, R> BiFunction<V1,V2,R> contextualize(BiFunction<V1,V2,R> function)
      Decorates the specified function with a given context.
      Type Parameters:
      V1 - the 1st function parameter type
      V2 - the 2nd function parameter type
      R - the function return type
      Parameters:
      function - a function
      Returns:
      a contextual function
    • contextualize

      <V1, V2, R, E extends Exception> org.wildfly.common.function.ExceptionBiFunction<V1,V2,R,E> contextualize(org.wildfly.common.function.ExceptionBiFunction<V1,V2,R,E> function)
      Decorates the specified function with a given context.
      Type Parameters:
      V1 - the 1st function parameter type
      V2 - the 2nd function parameter type
      R - the function return type
      E - the exception type
      Parameters:
      function - a function
      Returns:
      a contextual function
    • withContextProvider

      static Contextualizer withContextProvider(Supplier<Context> provider)
    • composite

      static Contextualizer composite(List<Contextualizer> contextualizers)