stateMachine

inline fun <S, E, C : Any, A : Any, R : Any> stateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, argumentClass: KClass<out A>, returnClass: KClass<out R>, handler: DslStateMachineHandler<S, E, C, A, R>.() -> Unit): DslStateMachineHandler<S, E, C, A, R>

Defines the start of a state machine DSL declaration

Author

Corneil du Plessis

Parameters

validStates

A set of the possible states supported by the top-level state map

validEvents

The class of the possible events

contextClass

The class of the context

argumentClass

The class of the argument to events/actions

returnClass

The class of the return type of events/actions

handler

Statemachine handler

Samples

io.jumpco.open.kfsm.TurnstileFSM.Companion.definition
inline fun <S, E, C : Any, A : Any> stateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, argumentClass: KClass<out A>, handler: DslStateMachineHandler<S, E, C, A, Any>.() -> Unit): DslStateMachineHandler<S, E, C, A, Any>

Defines the start of a state machine DSL declaration with Any as the return type

Parameters

validStates

A set of the possible states supported by the top-level state map

eventClass

The class of the possible events

contextClass

The class of the context

argumentClass

The class of the argument to events/actions

Samples

io.jumpco.open.kfsm.TurnstileFSM.definition
inline fun <S, E, C : Any> stateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, handler: DslStateMachineHandler<S, E, C, Any, Any>.() -> Unit): DslStateMachineHandler<S, E, C, Any, Any>

Defines the start of a state machine DSL declaration with Any as the type of arguments and returns types for events/actions

Parameters

validStates

A set of the possible states supported by the top-level state map

validEvents

The class of the possible events

contextClass

The class of the context

handler

The DSL handler

Samples

io.jumpco.open.kfsm.TurnstileFSM.definition