public final class MachineCoreBuilder
extends java.lang.Object
StateMachineBuilder to construct a state machine.
A machine core describes a single state machine with exactly one active state
at any time. Multiple cores can be combined into a StateMachine at
which point they are combined into a state machine cluster with common event
and command queues.
The builder does perform some preliminary data validation on every mutation.
A full data validation is performed by the StateMachineBuilder
whenever a core is added.
StateMachine,
StateMachineBuilder| Constructor and Description |
|---|
MachineCoreBuilder()
creates a new empty builder
|
MachineCoreBuilder(MachineCoreBuilder builder)
copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
MachineCoreBuilder |
addTransition(java.lang.String from,
java.lang.String event,
java.lang.String to,
java.lang.String[] events,
java.lang.String[] commands)
Adds a new transition between two states.
|
MachineCoreBuilder |
copy()
creates a copy of this builder instance.
|
MachineCoreBuilder |
setInitialState(java.lang.String state)
Sets the initial state of the state machine core.
|
public MachineCoreBuilder()
public MachineCoreBuilder(MachineCoreBuilder builder)
builder - the builder to copyjava.lang.NullPointerException - builder is nullpublic MachineCoreBuilder addTransition(java.lang.String from, java.lang.String event, java.lang.String to, java.lang.String[] events, java.lang.String[] commands)
from - the state the transition originates from. may not be
nullevent - the event that triggers the transition. may not be
nullto - the state the transition leads to. may be identical to
from. may not be nullevents - an array of all events that shall be triggered by the
transition. may be null. no element may be
nullcommands - an array of all commands that shall be triggered by the
transition. may be null. no element may be
nulljava.lang.NullPointerException - if any String parameter or any array element is
nullpublic MachineCoreBuilder setInitialState(java.lang.String state)
state - the initial state. may not be nulljava.lang.NullPointerException - state is nullpublic MachineCoreBuilder copy()
MachineCoreBuilder(MachineCoreBuilder)Copyright © 2017. All Rights Reserved.