public class StateMachineBuilder extends Object
StateMachine instances| Modifier and Type | Class and Description |
|---|---|
static class |
StateMachineBuilder.FilterBuilder
Internal builder class to begin the definition
of a new filter.
|
static class |
StateMachineBuilder.FromBuilder
Internal builder class to begin the definition
of a new transition.
|
static class |
StateMachineBuilder.OnBuilder
Internal builder class to optionally add
message filtering before ending the definition
of a new transition.
|
static class |
StateMachineBuilder.ToBuilder
Internal builder class to end the definition
of a new transition.
|
| Constructor and Description |
|---|
StateMachineBuilder()
The constructor
|
| Modifier and Type | Method and Description |
|---|---|
StateMachineBuilder |
add(@NonNull StateTransition transition)
Adds the given transition to the transition map.
|
StateMachineBuilder.FilterBuilder |
arriving(State state)
Initializes the builder to add a global
filter for arrivals for the given state.
|
StateMachineBuilder.FilterBuilder |
arriving(String stateName)
Initializes the builder to add a global
filter for arrivals for the state
specified by the given name.
|
StateMachine |
build()
Creates and initializes a State Machine
from the transition map currently built.
|
StateMachineBuilder.FromBuilder |
from(State srcState)
Starts the building of a new
transition by specifying the source
state.
|
StateMachineBuilder.FromBuilder |
from(String srcStateName)
Starts the building of a new
transition by specifying the source
state's name
|
StateTransitionMap |
getTransitionMap()
Retrieves the current transition map.
|
StateMachineBuilder.FilterBuilder |
leaving(State state)
Initializes the builder to add a global
filter for departures for the given state.
|
StateMachineBuilder.FilterBuilder |
leaving(String stateName)
Initializes the builder to add a global
filter for departures for the state
specified by the given name.
|
StateMachineBuilder.ToBuilder |
selfLoop(State state)
Starts a definition of a loop
for the given state
|
StateMachineBuilder.ToBuilder |
selfLoop(String stateName)
Starts the definition of a loop
for the given state's name
|
public StateMachineBuilder.FromBuilder from(String srcStateName)
srcStateName - the source state's namepublic StateMachineBuilder.FromBuilder from(State srcState)
srcState - the source statepublic StateMachineBuilder add(@NonNull @NonNull StateTransition transition)
transition - the transition to addpublic StateMachineBuilder.ToBuilder selfLoop(String stateName)
stateName - the state namepublic StateMachineBuilder.ToBuilder selfLoop(State state)
state - the statepublic StateMachineBuilder.FilterBuilder leaving(String stateName)
stateName - the state namepublic StateMachineBuilder.FilterBuilder leaving(State state)
state - the statepublic StateMachineBuilder.FilterBuilder arriving(String stateName)
stateName - the state namepublic StateMachineBuilder.FilterBuilder arriving(State state)
state - the statepublic StateMachine build()
public StateTransitionMap getTransitionMap()
Copyright © 2019 state-machine. All rights reserved.