public static final class CommandService.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
CommandService |
build() |
CommandService.Builder |
withCleanUpCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
Register an optional clean up command that will be executed when the all the normal commands finish
execution, regardless of the termination state of the last command.
|
CommandService.Builder |
withSingleCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
Register a single command that may be used by other transitions.
|
CommandService.Builder |
withStartCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
Register the start command.
|
CommandService.Builder |
withTransition(Class<? extends ICommand<? extends IBaseCommandData>> current,
Class<? extends ICommand<? extends IBaseCommandData>> next)
Register a transition from current command to the next command if current command is executed without error.
|
public CommandService.Builder withTransition(Class<? extends ICommand<? extends IBaseCommandData>> current, Class<? extends ICommand<? extends IBaseCommandData>> next)
current - the current commandnext - the next command to be executed if current finishes successfullypublic CommandService.Builder withStartCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
command - the start command.public CommandService.Builder withCleanUpCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
command - the clean up commandpublic CommandService.Builder withSingleCommand(Class<? extends ICommand<? extends IBaseCommandData>> command)
This ensures the command is instantiated early in the execution flow. It may be used for the followed
commands of an INextCommandAware command, where the transition is defined by the command.
command - the command to be registered.public CommandService build()
Copyright © 2016–2018. All rights reserved.