Package com.toxicbakery.kfinstatemachine

Types

IStateMachine
Link copied to clipboard
interface IStateMachine<S, T : Any>

State machine interface that requires the ability to transition finite states.

interface IStateMachine<S, T : Any>

State machine interface that requires the ability to transition finite states.

interface IStateMachine<S, T : Any>

State machine interface that requires the ability to transition finite states.

StateMachine
Link copied to clipboard
open class StateMachine<S, T : Any> : IStateMachine<S, T>

A basic state machine that is not thread safe.

open class StateMachine<S, T : Any> : IStateMachine<S, T>

A basic state machine that is not thread safe.

open class StateMachine<S, T : Any> : IStateMachine<S, T>

A basic state machine that is not thread safe.

TransitionBuilder
Link copied to clipboard
interface TransitionBuilder<out S, out T : Any>

Base definition for a partially defined transition.

interface TransitionBuilder<out S, out T : Any>

Base definition for a partially defined transition.

interface TransitionBuilder<out S, out T : Any>

Base definition for a partially defined transition.

TransitionCallback
Link copied to clipboard
interface TransitionCallback<S, T : Any>
interface TransitionCallback<S, T : Any>
interface TransitionCallback<S, T : Any>
TransitionDef
Link copied to clipboard
data class TransitionDef<S, T : Any>(    val oldState: S,     val transition: KClass<T>,     val newState: S)
data class TransitionDef<S, T : Any>(    val oldState: S,     val transition: KClass<T>,     val newState: S)
data class TransitionDef<S, T : Any>(    val oldState: S,     val transition: KClass<T>,     val newState: S)

Functions

onTransition
Link copied to clipboard
infix fun <S, T : Any> S.onTransition(event: KClass<out T>): TransitionBuilder<S, T>

Create a transition builder for a given state and transition event.

infix fun <S, T : Any> S.onTransition(event: KClass<out T>): TransitionBuilder<S, T>

Create a transition builder for a given state and transition event.

infix fun <S, T : Any> S.onTransition(event: KClass<out T>): TransitionBuilder<S, T>

Create a transition builder for a given state and transition event.

resultsIn
Link copied to clipboard
infix fun <S, T : Any> TransitionBuilder<S, T>.resultsIn(newState: S): TransitionDef<S, out T>

Define how a transition builder should end completing a fully defined transition definition.

infix fun <S, T : Any> TransitionBuilder<S, T>.resultsIn(newState: S): TransitionDef<S, out T>

Define how a transition builder should end completing a fully defined transition definition.

infix fun <S, T : Any> TransitionBuilder<S, T>.resultsIn(newState: S): TransitionDef<S, out T>

Define how a transition builder should end completing a fully defined transition definition.