Interface GenericRunnable

All Known Subinterfaces:
GenericRunnable.A0, GenericRunnable.A1<A>, GenericRunnable.A2<A,B>, GenericRunnable.A3<A,B,C>, GenericRunnable.A4<A,B,C,D>

public interface GenericRunnable
Represents a runnable or method reference with any number of arguments with any type, allowed to throw any exception.
Since:
2.10
  • Method Details

    • run

      void run(Object... args) throws Exception
      Runs this GenericRunnable.
      Parameters:
      args - The arguments
      Throws:
      IllegalArgumentException - If the number of elements in args does not match the value returned by getArgumentCount()
      Exception - Any exception thrown by the runnable
    • getArgumentCount

      int getArgumentCount()
      Returns the number of arguments this GenericRunnable accepts.
      Returns:
      The number of arguments
    • checkArgc

      default void checkArgc(int count)
      Checks whether count is the correct number of arguments for this GenericRunnable.
      Parameters:
      count -
      Throws:
      IllegalArgumentException - If count does not match the value returned by getArgumentCount()