findState

fun IState.findState(name: String, recursive: Boolean = true): IState?

Get state by name. This might be used to start listening to state after state machine setup.


inline fun <S : IState> IState.findState(recursive: Boolean = true): S?

Find state by type. Search by type is suitable when using own state subclasses that usually do not have a name. Only on state should match the type or exception will be thrown.


fun <S : IState> IState.findState(class: KClass<S>, recursive: Boolean = true): S?

For internal use. Workaround that Kotlin does not support recursive inline functions.