Package io.hektor.fsm.builder
Class FSMBuilder<S extends Enum<S>,C extends Context,D extends Data>
java.lang.Object
io.hektor.fsm.builder.FSMBuilder<S,C,D>
- Author:
- jonas@jonasborjesson.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefinition<S,C, D> build()Build the definition of the state machine and validate that all is well.StateBuilder<S,C, D> withFinalState(S state) FSMBuilder<S,C, D> withFriendlyName(String name) StateBuilder<S,C, D> withInitialState(S state) StateBuilder<S,C, D> StateBuilder<S,C, D> withTransientState(S state)
-
Constructor Details
-
FSMBuilder
-
-
Method Details
-
withFriendlyName
-
withInitialState
-
withFinalState
-
withState
- Throws:
StateAlreadyDefinedException
-
withTransientState
- Throws:
StateAlreadyDefinedException
-
build
Build the definition of the state machine and validate that all is well. The following rules will be validate upon building the definition:- Transitions with transformations can only be going to transient states and anything else is not allowed, hence, we will throw an exception.
- Returns:
- Throws:
FSMBuilderException- in case any issues with the FSM is detected.
-