abstract class StoryDataStepBase<T : StoryHandlerDefinition, TD, D> : StoryDataStep<T, TD, D>
(source)
Base class for StoryDataStep implementations.
T
- the StoryDef
<init> |
Base class for StoryDataStep implementations. StoryDataStepBase(select: TD.(T) -> Boolean = { false }, setup: T.(TD) -> D = {
@Suppress("UNCHECKED_CAST")
EmptyData as D
}, reply: T.(D) -> Any?) |
name |
The name of the step. open val name: String |
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 fun checkPreconditions(): T.(TD?) -> D? |
execute |
fun execute(storyDef: T, configuration: TD): Any? |
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. fun handler(): T.(D?) -> Any? |
reply |
fun reply(): T.(D) -> Any? |
select |
fun select(): TD.(T) -> 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. fun selectFromBusAndData(): T.(TD?) -> Boolean |
setup |
fun setup(): T.(TD) -> D |