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

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

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
open 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.

open 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.

open 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.

DefaultUpdatableStatesMachine
Link copied to clipboard
open class DefaultUpdatableStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : DefaultStatesMachine<T> , UpdatableStatesMachine<T>
open class DefaultUpdatableStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : DefaultStatesMachine<T> , UpdatableStatesMachine<T>
open class DefaultUpdatableStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : DefaultStatesMachine<T> , UpdatableStatesMachine<T>
State
Link copied to clipboard
interface State
interface State
interface State
StatesHandler
Link copied to clipboard
fun interface StatesHandler<I : State, O : State>

Default realization of states handler

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

Default realization of states handler

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

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>
UpdatableStatesMachine
Link copied to clipboard
interface UpdatableStatesMachine<T : State> : StatesMachine<T>

This extender of StatesMachine interface declare one new function updateChain. Realizations of this interface must be able to perform update of chain in internal StatesManager

interface UpdatableStatesMachine<T : State> : StatesMachine<T>

This extender of StatesMachine interface declare one new function updateChain. Realizations of this interface must be able to perform update of chain in internal StatesManager

interface UpdatableStatesMachine<T : State> : StatesMachine<T>

This extender of StatesMachine interface declare one new function updateChain. Realizations of this interface must be able to perform update of chain in internal StatesManager

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>