Interface FunctionExecutor<V>

Type Parameters:
V - the type of the function argument

public interface FunctionExecutor<V>
Encapsulates execution of a single argument function.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    <R, E extends Exception>
    R
    execute(ExceptionFunction<V,R,E> function)
    Executes the specified function, using a value provided by an associated ValueRegistry.
    static <V> FunctionExecutor<V>
    of(Supplier<V> reference)
    Creates a function executor from the specified argument supplier.
  • Method Details

    • of

      static <V> FunctionExecutor<V> of(Supplier<V> reference)
      Creates a function executor from the specified argument supplier.
      Type Parameters:
      V - the value type of the function argument
      Parameters:
      reference - a supplier of the function argument
      Returns:
      a new function executor instance
    • execute

      <R, E extends Exception> R execute(ExceptionFunction<V,R,E> function) throws E
      Executes the specified function, using a value provided by an associated ValueRegistry.
      Type Parameters:
      R - the return type
      E - the exception type
      Parameters:
      function - a function to execute
      Returns:
      the result of the function
      Throws:
      E - if the function fails to execute