Package-level declarations

Types

Link copied to clipboard
data class InvalidStateForTransition(transition: Transition<*, *, *>, val value: Value<*, *, *>) : Exception
Link copied to clipboard
data class InvalidStateMachine(val message: String) : Exception
Link copied to clipboard
interface Invariant<ID, V : Value<ID, V, S>, S : State<ID, V, S>>

Represents an invariant that must hold true for a value in a particular state.

Link copied to clipboard
class NoPathToTargetState(val value: Value<*, *, *>, val targetState: State<*, *, *>) : Exception
Link copied to clipboard
data class PreconditionNotMet(val message: String) : Exception

Exception thrown when a value fails to meet an invariant.

Link copied to clipboard
open class State<ID, V : Value<ID, V, S>, S : State<ID, V, S>>(transitionsFn: () -> Set<S>, invariants: List<Invariant<ID, V, S>> = emptyList())
Link copied to clipboard
Link copied to clipboard
data class States<ID, V : Value<ID, V, S>, S : State<ID, V, S>>(val a: S, val other: Set<S>)

A collection of states that is guaranteed to be non-empty.

Link copied to clipboard
open class Transition<ID, V : Value<ID, V, S>, S : State<ID, V, S>>(val from: States<ID, V, S>, val to: S)
Link copied to clipboard
abstract class Transitioner<ID, T : Transition<ID, V, S>, V : Value<ID, V, S>, S : State<ID, V, S>>
Link copied to clipboard
abstract class TransitionerAsync<ID, T : Transition<ID, V, S>, V : Value<ID, V, S>, S : State<ID, V, S>>
Link copied to clipboard
interface Value<ID, V : Value<ID, V, S>, S : State<ID, V, S>>

Represents a value that can transition between different states in a finite state machine.

Functions

Link copied to clipboard
fun <ID, V : Value<ID, V, S>, S : State<ID, V, S>> invariant(message: String, predicate: (V) -> Boolean): Invariant<ID, V, S>

Creates an invariant that checks if the given predicate holds true for the value.