public static class StateMachineBuilder.ToBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
StateMachineBuilder.OnBuilder |
arriving(@NonNull Function<StateContext,Status> handler)
Adds a filtering function for incoming messages in target state
of the transition by transforming the current target state into
a
FilteredState. |
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()
Finish the current transition and retrieves
the current state machine built instance.
|
StateMachineBuilder.FromBuilder |
from(State state)
Starts a new transition from the given
state using an empty
message for the current transition.
|
StateMachineBuilder.FromBuilder |
from(String state)
Starts a new transition from the given
state name using an empty
message for the current transition.
|
StateMachineBuilder.OnBuilder |
leaving(Function<StateContext,Status> handler)
Adds a filtering function for triggering messages from origin state
of the transition by transforming the current origin state into
a
FilteredState. |
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.OnBuilder |
on(Message message)
Ends the transition by applying a custom message and
retrieving the initial builder.
|
StateMachineBuilder.OnBuilder |
on(String message)
Ends the transition by applying the message and
retrieving the initial builder.
|
StateMachineBuilder.ToBuilder |
selfLoop(State state)
Creates a self loop for the given state.
|
StateMachineBuilder.ToBuilder |
selfLoop(String state)
Creates a self loop for the state
specified by the given name.
|
public StateMachineBuilder.FromBuilder from(String state)
state - the next source statepublic StateMachineBuilder.FromBuilder from(State state)
state - the next source statepublic StateMachineBuilder.ToBuilder selfLoop(String state)
state - the state namepublic StateMachineBuilder.ToBuilder selfLoop(State state)
state - the statepublic StateMachine build()
public StateMachineBuilder.OnBuilder on(String message)
message - the string message to addpublic StateMachineBuilder.OnBuilder on(Message message)
message - the custom message to addpublic 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 StateMachineBuilder.OnBuilder leaving(Function<StateContext,Status> handler)
FilteredState.handler - the handler function to execute when leaving originStateMachineBuilder.OnBuilder instancepublic StateMachineBuilder.OnBuilder arriving(@NonNull @NonNull Function<StateContext,Status> handler)
FilteredState.handler - the handler function to execute when arriving targetStateMachineBuilder.OnBuilder instanceCopyright © 2019 state-machine. All rights reserved.