Interface Runnable

All Superinterfaces:
Runnable

public interface Runnable extends Runnable
An enhanced runnable.
Author:
Paul Ferraro
  • Field Summary

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

    Modifier and Type
    Method
    Description
    default Runnable
    Returns a task that runs the specified task after running this task.
    static Runnable
    Returns an empty task.
    static Runnable
    of(Iterable<? extends Runnable> tasks)
    Returns a composite task that runs the specified task.
    static <T> Runnable
    of(Consumer<? super T> consumer, Supplier<? extends T> supplier)
    Returns a task that consumes a value from the specified supplier.

    Methods inherited from interface java.lang.Runnable

    run
  • Field Details

  • Method Details

    • andThen

      default Runnable andThen(Runnable task)
      Returns a task that runs the specified task after running this task.
      Parameters:
      task - a task to run after this task
      Returns:
      a task that runs the specified task after running this task.
    • empty

      static Runnable empty()
      Returns an empty task.
      Returns:
      an empty task.
    • of

      static <T> Runnable of(Consumer<? super T> consumer, Supplier<? extends T> supplier)
      Returns a task that consumes a value from the specified supplier.
      Type Parameters:
      T - the consumed value
      Parameters:
      consumer - a consumer of the supplied value
      supplier - a supplier of the consumed value
      Returns:
      a task that consumes a value from the specified supplier.
    • of

      static Runnable of(Iterable<? extends Runnable> tasks)
      Returns a composite task that runs the specified task.
      Parameters:
      tasks - zero or more tasks
      Returns:
      a composite task that runs the specified task.