Package-level declarations

Types

Link copied to clipboard
abstract class BaseGuardedTransitionBuilder<E : Event>(name: String?, sourceState: IState) : TransitionBuilder<E>
Link copied to clipboard
Link copied to clipboard

Type safe argument transition builder

Link copied to clipboard

Type safe argument transitionOn builder

Link copied to clipboard
open class DefaultTransition<E : Event>(val name: String?, val eventMatcher: EventMatcher<E>, val type: TransitionType, sourceState: IState, val metaInfo: MetaInfo?) : InternalTransition<E>
Link copied to clipboard
data class EventAndArgument<E : Event>(val event: E, val argument: Any?)

Pair of event and argument coming from processEvent() method. Used as single argument in all guard and conditional callbacks same as TransitionParams for transitions

Link copied to clipboard
abstract class GuardedTransitionBuilder<E : Event, S : IState>(name: String?, sourceState: IState) : BaseGuardedTransitionBuilder<E>
Link copied to clipboard
abstract class GuardedTransitionOnBuilder<E : Event, S : IState>(name: String?, sourceState: IState) : BaseGuardedTransitionBuilder<E>
Link copied to clipboard

Defines transition API for internal library usage. All transitions must implement this interface. This is safe to cast any Transition to InternalTransition by design.

Link copied to clipboard

Transition that matches event and has a meaningful direction (except NoTransition)

Link copied to clipboard

Represent a transition between states, which gets triggered when specified Event is posted to StateMachine

Link copied to clipboard
abstract class TransitionBuilder<E : Event>(name: String?, sourceState: IState)
Link copied to clipboard
sealed interface TransitionDirection

Caller should check subclass to recognise/distinguish NoTransition and Stay cases.

Link copied to clipboard
data class TransitionParams<E : Event>
Link copied to clipboard

Most of the cases EXTERNAL and LOCAL transition are functionally equivalent except in cases where transition is happening between super and sub-states. Local transition doesn't cause exit and entry to source state if target state is a sub-state of a source state. Other way around, local transition doesn't cause exit and entry to target state if target is a superstate of a source state.

Link copied to clipboard

Any Event (with any data) can lead to State

Properties

Link copied to clipboard

Convenience property for unwrapping original argument. If the event is not WrappedEvent this is same as TransitionParams.argument property

Link copied to clipboard

Convenience property for unwrapping original event. If the event is not WrappedEvent this is same as TransitionParams.event property

Functions

Link copied to clipboard
Link copied to clipboard
inline fun <E : Event> TransitionBuilder<E>.onComplete(crossinline block: suspend (activeStates: Set<IState>, transitionParams: TransitionParams<E>) -> Unit): Transition.Listener
inline fun <E : Event> Transition<E>.onComplete(crossinline block: suspend (activeStates: Set<IState>, TransitionParams<E>) -> Unit): Transition.Listener
Link copied to clipboard
inline fun <E : Event> TransitionBuilder<E>.onTriggered(crossinline block: suspend (TransitionParams<E>) -> Unit): Transition.Listener
inline fun <E : Event> Transition<E>.onTriggered(crossinline block: suspend (TransitionParams<E>) -> Unit): Transition.Listener
Link copied to clipboard
Link copied to clipboard
suspend fun EventAndArgument<*>.targetParallelStates(targetState1: IState, targetState2: IState, vararg targetStates: IState): TransitionDirection
Link copied to clipboard

Transition is triggered with a targetState, resolving it in place if it is a PseudoState