java.lang.Object
xyz.ronella.trivial.command.Invoker

public final class Invoker extends Object
Invokes an implementation of basic functional interfaces.
Since:
2019-11-28
  • Method Summary

    Modifier and Type
    Method
    Description
    static <TYPE_ARG1, TYPE_ARG2>
    void
    execute(BiConsumer<TYPE_ARG1,TYPE_ARG2> logic)
    Executes an implementation BiConsumer but passed in nulls for the arguments.
    static <TYPE_ARG1, TYPE_ARG2>
    void
    execute(BiConsumer<TYPE_ARG1,TYPE_ARG2> logic, TYPE_ARG1 arg1, TYPE_ARG2 arg2)
    Executes an implementation BiConsumer.
    static <TYPE> void
    execute(Consumer<TYPE> logic)
    Executes an implementation Consumer but passed in null to the argument.
    static <TYPE> void
    execute(Consumer<TYPE> logic, TYPE arg)
    Executes an implementation Consumer.
    static <TYPE_RETURN>
    TYPE_RETURN
    generate(Supplier<TYPE_RETURN> logic)
    Executes an implementation of Supplier.
    static void
    plunge(Sink logic)
    Executes an implementation of Sink
    static <TYPE_ARG1, TYPE_ARG2, TYPE_RETURN>
    TYPE_RETURN
    process(BiFunction<TYPE_ARG1,TYPE_ARG2,TYPE_RETURN> logic, TYPE_ARG1 arg1, TYPE_ARG2 arg2)
    Executes an implementation of BiFunction.
    static <TYPE_ARG, TYPE_RETURN>
    TYPE_RETURN
    process(Function<TYPE_ARG,TYPE_RETURN> logic, TYPE_ARG arg)
    Executes an implementation of Function.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • execute

      public static <TYPE_ARG1, TYPE_ARG2> void execute(BiConsumer<TYPE_ARG1,TYPE_ARG2> logic, TYPE_ARG1 arg1, TYPE_ARG2 arg2)
      Executes an implementation BiConsumer.
      Type Parameters:
      TYPE_ARG1 - The type of the first parameter.
      TYPE_ARG2 - The type of the second parameter.
      Parameters:
      logic - The BiConsumer implementation.
      arg1 - The first parameter for the BiConsumer.
      arg2 - The second parameter for the BiConsumer.
    • execute

      public static <TYPE_ARG1, TYPE_ARG2> void execute(BiConsumer<TYPE_ARG1,TYPE_ARG2> logic)
      Executes an implementation BiConsumer but passed in nulls for the arguments.
      Type Parameters:
      TYPE_ARG1 - The type of the first parameter.
      TYPE_ARG2 - The type of the second parameter.
      Parameters:
      logic - The BiConsumer implementation.
      Since:
      2.0.0
    • process

      public static <TYPE_ARG1, TYPE_ARG2, TYPE_RETURN> TYPE_RETURN process(BiFunction<TYPE_ARG1,TYPE_ARG2,TYPE_RETURN> logic, TYPE_ARG1 arg1, TYPE_ARG2 arg2)
      Executes an implementation of BiFunction.
      Type Parameters:
      TYPE_ARG1 - The type of the first parameter.
      TYPE_ARG2 - The type of the second parameter.
      TYPE_RETURN - The type of the expected return value.
      Parameters:
      logic - The BiFunction implementation.
      arg1 - The first parameter for the BiFunction.
      arg2 - The second parameter for the BiFunction.
      Returns:
      The output of a BiFunction.
    • execute

      public static <TYPE> void execute(Consumer<TYPE> logic, TYPE arg)
      Executes an implementation Consumer.
      Type Parameters:
      TYPE - The type of the parameter.
      Parameters:
      logic - The Consumer implementation.
      arg - The parameter for the Consumer.
    • execute

      public static <TYPE> void execute(Consumer<TYPE> logic)
      Executes an implementation Consumer but passed in null to the argument.
      Type Parameters:
      TYPE - The type of the parameter.
      Parameters:
      logic - The Consumer implementation.
      Since:
      2.0.0
    • process

      public static <TYPE_ARG, TYPE_RETURN> TYPE_RETURN process(Function<TYPE_ARG,TYPE_RETURN> logic, TYPE_ARG arg)
      Executes an implementation of Function.
      Type Parameters:
      TYPE_ARG - The type of the parameter.
      TYPE_RETURN - The type of the expected return value.
      Parameters:
      logic - The Function implementation.
      arg - The parameter for the Function.
      Returns:
      The output of a Function.
    • generate

      public static <TYPE_RETURN> TYPE_RETURN generate(Supplier<TYPE_RETURN> logic)
      Executes an implementation of Supplier.
      Type Parameters:
      TYPE_RETURN - The type of the expected return value.
      Parameters:
      logic - The Supplier implementation.
      Returns:
      The output of a Supplier.
    • plunge

      public static void plunge(Sink logic)
      Executes an implementation of Sink
      Parameters:
      logic - The Sink implementation.