Package dev.inmo.micro_utils.fsm.common

Types

CheckableHandlerHolder
Link copied to clipboard
interface CheckableHandlerHolder<I : State, O : State> : StatesHandler<I, O>

Define checkable holder which can be used to precheck that this handler may handle incoming State

common
interface CheckableHandlerHolder<I : State, O : State> : StatesHandler<I, O>

Define checkable holder which can be used to precheck that this handler may handle incoming State

interface CheckableHandlerHolder<I : State, O : State> : StatesHandler<I, O>

Define checkable holder which can be used to precheck that this handler may handle incoming State

CustomizableHandlerHolder
Link copied to clipboard
class CustomizableHandlerHolder<I : O, O : State>(delegateTo: StatesHandler<I, O>, filter: suspend (O) -> Boolean) : CheckableHandlerHolder<I, O>

Default realization of StatesHandler. It will incapsulate checking of State type in checkHandleable and class casting in handleState

common
class CustomizableHandlerHolder<I : O, O : State>(delegateTo: StatesHandler<I, O>, filter: suspend (O) -> Boolean) : CheckableHandlerHolder<I, O>

Default realization of StatesHandler. It will incapsulate checking of State type in checkHandleable and class casting in handleState

class CustomizableHandlerHolder<I : O, O : State>(delegateTo: StatesHandler<I, O>, filter: suspend (O) -> Boolean) : CheckableHandlerHolder<I, O>

Default realization of StatesHandler. It will incapsulate checking of State type in checkHandleable and class casting in handleState

DefaultStatesMachine
Link copied to clipboard
class DefaultStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : StatesMachine<T>

Default realization of StatesMachine. It uses statesManager for incapsulation of States storing and contexts resolving, and uses launchStateHandling for State handling

common
class DefaultStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : StatesMachine<T>

Default realization of StatesMachine. It uses statesManager for incapsulation of States storing and contexts resolving, and uses launchStateHandling for State handling

class DefaultStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : StatesMachine<T>

Default realization of StatesMachine. It uses statesManager for incapsulation of States storing and contexts resolving, and uses launchStateHandling for State handling

State
Link copied to clipboard
interface State
interface State
interface State
StatesHandler
Link copied to clipboard
fun interface StatesHandler<I : State, O : State>
fun interface StatesHandler<I : State, O : State>
fun interface StatesHandler<I : State, O : State>

Default realization of states handler

StatesMachine
Link copied to clipboard
interface StatesMachine<T : State> : StatesHandler<T, T>

Default StatesMachine may startChain and use inside logic for handling States. By default you may use DefaultStatesMachine or build it with dev.inmo.micro_utils.fsm.common.dsl.buildFSM. Implementers MUST NOT start handling until start method will be called

common
interface StatesMachine<T : State> : StatesHandler<T, T>

Default StatesMachine may startChain and use inside logic for handling States. By default you may use DefaultStatesMachine or build it with dev.inmo.micro_utils.fsm.common.dsl.buildFSM. Implementers MUST NOT start handling until start method will be called

interface StatesMachine<T : State> : StatesHandler<T, T>

Default StatesMachine may startChain and use inside logic for handling States. By default you may use DefaultStatesMachine or build it with dev.inmo.micro_utils.fsm.common.dsl.buildFSM. Implementers MUST NOT start handling until start method will be called

StatesManager
Link copied to clipboard
interface StatesManager<T : State>
interface StatesManager<T : State>
interface StatesManager<T : State>

Functions

CheckableHandlerHolder
Link copied to clipboard
inline fun <I : O, O : State> CheckableHandlerHolder(strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
fun <I : O, O : State> CheckableHandlerHolder(inputKlass: KClass<I>, strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> CheckableHandlerHolder(strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
fun <I : O, O : State> CheckableHandlerHolder(inputKlass: KClass<I>, strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> CheckableHandlerHolder(strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
fun <I : O, O : State> CheckableHandlerHolder(inputKlass: KClass<I>, strict: Boolean = false, delegateTo: StatesHandler<I, O>): CustomizableHandlerHolder<O, O>
holder
Link copied to clipboard
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>