-
public class DynamicCommandBuilder extends CommandBuilder<Command>
-
-
Field Summary
Fields Modifier and Type Field Description public Supplier<Boolean>triggerConditionpublic Runnablerunnablepublic Commandsubcommandpublic Supplier<Boolean>stopCondition
-
Method Summary
Modifier and Type Method Description DynamicCommandBuilderwhen(Supplier<Boolean> triggerCondition)Sets the trigger condition for the command. DynamicCommandBuilderwhen(Function<CommandConditionBuilder, Supplier<Boolean>> conditionFunction)Sets the trigger condition for the command. DynamicCommandBuilderexecute(Runnable runnable)Sets the command lambda. DynamicCommandBuilderexecute(Command subCommand)Sets the command lambda. DynamicCommandBuilderuntil(Supplier<Boolean> stopCondition)Sets the command stop condition. Commandbuild(String commandName)Builds the command. -
-
Method Detail
-
when
DynamicCommandBuilder when(Supplier<Boolean> triggerCondition)
Sets the trigger condition for the command.
- Parameters:
triggerCondition- trigger condition.
-
when
DynamicCommandBuilder when(Function<CommandConditionBuilder, Supplier<Boolean>> conditionFunction)
Sets the trigger condition for the command.
- Parameters:
conditionFunction- condition provider.
-
execute
DynamicCommandBuilder execute(Runnable runnable)
Sets the command lambda.
- Parameters:
runnable- command lambda.
-
execute
DynamicCommandBuilder execute(Command subCommand)
Sets the command lambda.
- Parameters:
subCommand- subcommand to run.
-
until
DynamicCommandBuilder until(Supplier<Boolean> stopCondition)
Sets the command stop condition.
- Parameters:
stopCondition- stop condition lambda
-
-
-
-