-
class TaskNode.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder(TaskNode.GraphType type)
-
Method Summary
Modifier and Type Method Description TaskNode.BuilderwithTask(String name, Class<out Task> implementingClass)Adds a task to the current graph. TaskNode.BuilderwithTask(TaskNode task)Adds a task to the current graph. TaskNode.BuilderwithLoop(Consumer<TaskNode.Builder> subGraph)Adds a sub-graph of tasks that may loop if any of them return . TaskNode.TaskGraphbuild()-
-
Constructor Detail
-
Builder
Builder(TaskNode.GraphType type)
-
-
Method Detail
-
withTask
TaskNode.Builder withTask(String name, Class<out Task> implementingClass)
Adds a task to the current graph.
- Parameters:
name- the name of the task.implementingClass- the class that implements the task.
-
withTask
TaskNode.Builder withTask(TaskNode task)
Adds a task to the current graph.
- Parameters:
task- the task node to add
-
withLoop
TaskNode.Builder withLoop(Consumer<TaskNode.Builder> subGraph)
Adds a sub-graph of tasks that may loop if any of them return . The sub-graph will run after any previously added tasks and before any subsequently added ones. If the final task in the sub-graph returns the tasks in the sub-graph will be run again. If it returns the sub-graph will exit.
- Parameters:
subGraph- a lambda that defines the tasks for the sub-graph by adding them to a @ { link Builder .
-
build
TaskNode.TaskGraph build()
-
-
-
-