Class ReplyFlow.ReplyFlowBuilder
Object
ReplyFlowBuilder
- Enclosing class:
- ReplyFlow
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaction(BiConsumer<BaseAbilityBot, Update> action) build()enableStats(String name) validate(Predicate<Update> validator, BiConsumer<BaseAbilityBot, Update> failureAction) This is validation step of the flow
-
Field Details
-
STATES
- See Also:
-
-
Method Details
-
action
-
validate
public ReplyFlow.ReplyFlowBuilder validate(Predicate<Update> validator, BiConsumer<BaseAbilityBot, Update> failureAction) This is validation step of the flowExecutes by the folloiwng steps
onlyIf->validate->actionBehavior:
- If
validatorreturnstrue: flow proceeds normally (executes main action, updates state). - If
validatorreturnsfalse: ThefailureActionis executed, the main action is skipped, and the user's state remains unchanged (it is NOT updated to the new state ID).
- Parameters:
validator- a predicate to check the update (like verifying a password).failureAction- the callback to execute if validation fails (like sending an error message to the user).- Returns:
- current
ReplyFlow.ReplyFlowBuilderinstance for chaining
- If
-
enableStats
-
onlyIf
-
next
-
next
-
build
-