Package com.discord4j.fsm
Class FiniteStateMachine<S,E>
- java.lang.Object
-
- com.discord4j.fsm.FiniteStateMachine<S,E>
-
public abstract class FiniteStateMachine<S,E> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FiniteStateMachine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SgetCurrentState()voidonEvent(E event)voidonUnhandled(java.util.function.Function<? super E,? extends S> fallbackHandler)voidstartWith(S initialState)<U extends S>
StateMachineDSL<S,E,U>when(java.lang.Class<U> fromState)StateMachineDSL<S,E,S>whenAny()
-
-
-
Method Detail
-
startWith
public void startWith(S initialState)
-
when
public <U extends S> StateMachineDSL<S,E,U> when(java.lang.Class<U> fromState)
-
whenAny
public StateMachineDSL<S,E,S> whenAny()
-
onUnhandled
public void onUnhandled(java.util.function.Function<? super E,? extends S> fallbackHandler)
-
onEvent
public void onEvent(E event)
-
getCurrentState
public S getCurrentState()
-
-