Package org.kquiet.browser
Class ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder
java.lang.Object
org.kquiet.browser.ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder
- Enclosing class:
- ActionComposerBuilder.ActionSequenceBuilder
A builder to build
IfThenElse in a fluent way.-
Constructor Summary
ConstructorsConstructorDescriptionIfThenElseBuilder(ActionComposerBuilder.ActionSequenceBuilder parentActionSequenceBuilder, Function<ActionComposer, ?> evalFunction) Create a newActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderwith specifiedActionComposerBuilder.ActionSequenceBuilderas parent builder. -
Method Summary
Modifier and TypeMethodDescriptionendIf()Finish buildingIfThenElseand add it to parent builder.Start building the action list for the negative result of predicate.Finish building the sequence of actions so far and return control to root builder (ActionComposerBuilder).then()Start building the action list for the positive result of predicate.
-
Constructor Details
-
IfThenElseBuilder
public IfThenElseBuilder(ActionComposerBuilder.ActionSequenceBuilder parentActionSequenceBuilder, Function<ActionComposer, ?> evalFunction) Create a newActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderwith specifiedActionComposerBuilder.ActionSequenceBuilderas parent builder.- Parameters:
parentActionSequenceBuilder- parent builder(ActionComposerBuilder.ActionSequenceBuilder)evalFunction- the function to evaluate
-
-
Method Details
-
returnToComposerBuilder
Finish building the sequence of actions so far and return control to root builder (ActionComposerBuilder).- Returns:
- root builder(
ActionComposerBuilder)
-
then
Start building the action list for the positive result of predicate.- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilderwith thisActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderas parent builder
-
otherwise
Start building the action list for the negative result of predicate.- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilderwith thisActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderas parent builder
-
endIf
Finish buildingIfThenElseand add it to parent builder.- Returns:
- parent builder(
ActionComposerBuilder.ActionSequenceBuilder)
-