Class TaskRecipe.TaskRecipeComponentOutputting<I,O>

java.lang.Object
cloud.commandframework.tasks.TaskRecipe.TaskRecipeComponentOutputting<I,O>
Type Parameters:
I - Input type
O - Output type
Enclosing class:
TaskRecipe

public final class TaskRecipe.TaskRecipeComponentOutputting<I,O> extends Object
Represents a partial recipe
  • Method Details

    • synchronous

      public <T> TaskRecipe.TaskRecipeComponentOutputting<O,T> synchronous(@NonNull TaskFunction<O,T> function)
      Add a new synchronous step, consuming the input of the earlier step
      Type Parameters:
      T - Output type
      Parameters:
      function - Function mapping the input to some output
      Returns:
      New task recipe component
    • asynchronous

      public <T> TaskRecipe.TaskRecipeComponentOutputting<O,T> asynchronous(@NonNull TaskFunction<O,T> function)
      Add a new asynchronous step, consuming the input of the earlier step
      Type Parameters:
      T - Output type
      Parameters:
      function - Function mapping the input to some output
      Returns:
      New task recipe component
    • synchronous

      public TaskRecipe.TaskRecipeComponentVoid<O> synchronous(@NonNull TaskConsumer<O> consumer)
      Add a new synchronous step, consuming the input of the earlier step
      Parameters:
      consumer - Consumer that consumes the input
      Returns:
      New task recipe component
    • asynchronous

      public TaskRecipe.TaskRecipeComponentVoid<O> asynchronous(@NonNull TaskConsumer<O> consumer)
      Add a new asynchronous step, consuming the input of the earlier step
      Parameters:
      consumer - Consumer that consumes the input
      Returns:
      New task recipe component
    • execute

      public void execute(@NonNull Runnable callback)
      Execute the recipe
      Parameters:
      callback - Callback function
    • execute

      public void execute()
      Execute the recipe