T - the StoryDef
TD - the StoryDef data
D - the step data
public class StoryDataStepBase<T extends StoryHandlerDefinition,TD,D> implements StoryDataStep<T,TD,D>
Base class for interface StoryDataStep implementations.
interface StoryDataSteppublic StoryDataStepBase(@NotNull
kotlin.jvm.functions.Function2<? super TD,? super T,java.lang.Boolean> select,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super TD,? extends D> setup,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super D,? extends java.lang.Object> reply)
Base class for interface StoryDataStep implementations.
interface StoryDataStep@NotNull public kotlin.jvm.functions.Function2<TD,T,java.lang.Boolean> select()
@NotNull public kotlin.jvm.functions.Function2<T,TD,D> setup()
@NotNull public kotlin.jvm.functions.Function2<T,D,java.lang.Object> reply()
@Nullable
public java.lang.Object execute(@NotNull
T storyDef,
TD configuration)
@NotNull public kotlin.jvm.functions.Function2<T,TD,java.lang.Boolean> selectFromBusAndData()
Does this Step has to be selected from the Bus?
This method is called if StoryHandlerBase.checkPreconditions does not call BotBus.end.
If this functions returns true, the step is selected and remaining steps are not tested.
StoryHandlerBase.checkPreconditions,
BotBus.end@NotNull public kotlin.jvm.functions.Function2<T,TD,D> checkPreconditions()
Checks preconditions - if BotBus.end is called,
StoryHandlerDefinition.handle is not called and the handling of bot answer is over.
Returned data is used in subsequent call of handler if not null
else StoryHandlerBase.checkPreconditions returned data is used.
@NotNull public kotlin.jvm.functions.Function2<T,D,java.lang.Object> handler()
The custom handler for this step. When returning a null value, it means that the step is not able to answer to the current request.
Default implementation returns null.
@NotNull public java.lang.String getName()
The name of the step. usually automatically defined by the enum field.