| Package | Description |
|---|---|
| com.github.pnavais.machine | |
| com.github.pnavais.machine.builder | |
| com.github.pnavais.machine.exporter | |
| com.github.pnavais.machine.impl | |
| com.github.pnavais.machine.model |
| Modifier and Type | Method and Description |
|---|---|
State |
StateMachine.getCurrent()
Retrieves the current state
|
| Modifier and Type | Method and Description |
|---|---|
Optional<State> |
StateMachine.find(String stateName)
Finds the state referenced by the given name
in the state machine
machine.
|
Optional<State> |
StateMachine.getNext(Message m)
Retrieves the next state upon
message reception.
|
Collection<State> |
StateMachine.getSiblings(String stateName)
Retrieves the adjacent states i.e.
|
TransitionIndex<State,Message,StateTransition> |
StateMachine.getTransitionsIndex()
Retrieves the transition map
|
List<State> |
StateMachine.prune()
Remove orphan states
|
| Modifier and Type | Method and Description |
|---|---|
void |
StateMachine.remove(State state)
Removes an existing state from the state machine.
|
void |
StateMachine.setCurrent(@NonNull State state)
Sets the current state if present
|
| Modifier and Type | Method and Description |
|---|---|
StateMachineBuilder.FilterBuilder |
StateMachineBuilder.arriving(State state)
Initializes the builder to add a global
filter for arrivals for the given state.
|
StateMachineBuilder.FilterBuilder |
StateMachineBuilder.ToBuilder.arriving(State state)
Initializes the builder to add a global
filter for arrivals for the given state.
|
StateMachineBuilder.FromBuilder |
StateMachineBuilder.from(State srcState)
Starts the building of a new
transition by specifying the source
state.
|
StateMachineBuilder.FromBuilder |
StateMachineBuilder.ToBuilder.from(State state)
Starts a new transition from the given
state using an empty
message for the current transition.
|
StateMachineBuilder.FromBuilder |
StateMachineBuilder.OnBuilder.from(State state)
Starts a new transition from the given
state using an empty
message for the current transition.
|
StateMachineBuilder.FilterBuilder |
StateMachineBuilder.leaving(State state)
Initializes the builder to add a global
filter for departures for the given state.
|
StateMachineBuilder.FilterBuilder |
StateMachineBuilder.ToBuilder.leaving(State state)
Initializes the builder to add a global
filter for departures for the given state.
|
StateMachineBuilder.ToBuilder |
StateMachineBuilder.selfLoop(State state)
Starts a definition of a loop
for the given state
|
StateMachineBuilder.ToBuilder |
StateMachineBuilder.ToBuilder.selfLoop(State state)
Creates a self loop for the given state.
|
StateMachineBuilder.ToBuilder |
StateMachineBuilder.OnBuilder.selfLoop(State state)
Creates a self loop for the given state.
|
StateMachineBuilder.ToBuilder |
StateMachineBuilder.FromBuilder.to(State targetStateName)
Adds a new target state by it's name
to the transition under build.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractStatesExporter<R,S extends State,M extends Message,T extends Transitioner<S,M,? extends Transition<S,M>>> |
| Modifier and Type | Method and Description |
|---|---|
Optional<State> |
StateTransitionMap.find(String stateName)
Finds the given state by its name.
|
Optional<State> |
StateTransitionMap.getFirst()
Retrieves the first state in the transition map
|
Optional<State> |
StateTransitionMap.getNext(@NonNull State source,
@NonNull Message m)
Retrieves the next state in the transition from
source state upon message m reception
|
Optional<State> |
StateTransitionMap.getPrevious(State source,
Message m)
Retrieves the previous node upon reception of the
message on the given source node.
|
Map<State,Map<Message,State>> |
StateTransitionMap.getTransitionsAsMap()
Retrieves the transitions as a map
|
Map<State,Map<Message,State>> |
StateTransitionMap.getTransitionsAsMap()
Retrieves the transitions as a map
|
List<State> |
StateTransitionMap.prune()
Remove orphan states from the transition map
i.e.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
StateTransitionMap.contains(@NonNull State state)
Checks the presence of the given state in
the index.
|
Optional<State> |
StateTransitionMap.getNext(@NonNull State source,
@NonNull Message m)
Retrieves the next state in the transition from
source state upon message m reception
|
Optional<State> |
StateTransitionMap.getPrevious(State source,
Message m)
Retrieves the previous node upon reception of the
message on the given source node.
|
Collection<StateTransition> |
StateTransitionMap.getTransitions(State state)
Retrieves the transitions from the given state
or throws a
NullStateException
if not found. |
void |
StateTransitionMap.remove(@NonNull State state)
Removes the current state from the machine
including defined transitions.
|
| Modifier and Type | Method and Description |
|---|---|
ValidationResult |
StateTransitionValidator.validate(StateTransition transition,
TransitionIndex<State,Message,StateTransition> transitionIndex,
TransitionValidator.Operation operation)
Checks the transition parameter correctness
with respect to current transitions on the given
index before applying the operation.
|
Status |
StateTransitionChecker.validateArrival(Envelope<State,Message> envelope)
Validates the arrival to a given target state upon reception
of a given message using the specified transition index to ensure
transitions are accepted.
|
Status |
StateTransitionChecker.validateDeparture(Envelope<State,Message> envelope)
Validates the departure from the current state upon reception
of a given message using the specified transition index to ensure
transitions are accepted.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractFilteredState
Base class for all Message filter state decorators
|
class |
AbstractWrappedState
This class is intended to contain the actual State
instance in order to be stored in a state machine.
|
class |
FilteredState
A decorator adding message filtering functionality
to regular states.
|
| Modifier and Type | Field and Description |
|---|---|
protected State |
AbstractWrappedState.state
The target State.
|
| Modifier and Type | Method and Description |
|---|---|
State |
State.addProperty(@NonNull String key,
@NonNull String value)
Adds the property with the given key and value.
|
State |
State.StateBuilder.build()
Retrieves the built instance
|
static State |
State.named(String name)
Static factory method to create the State with name.
|
State |
State.removeProperty(@NonNull String key)
Removes the property identified by the given key
or discard the operation silently if not found.
|
| Modifier and Type | Method and Description |
|---|---|
abstract MessageFilter<State,StateContext> |
AbstractFilteredState.getMessageFilter()
Retrieves the message filter
|
| Modifier and Type | Method and Description |
|---|---|
static FilteredState |
FilteredState.from(@NonNull State state)
Static factory method to decorate the state with
message filtering capabilities
|
| Constructor and Description |
|---|
AbstractFilteredState(@NonNull State state)
Constructor with the state to wrap
|
AbstractWrappedState(@NonNull State state)
Constructor with the state to wrap
|
FilteredState(@NonNull State state)
Constructor with state
|
SimpleEnvelope(State source,
Message message,
State target,
TransitionIndex<State,Message,StateTransition> transitionIndex) |
StateContext(Event event,
State source,
State target,
Message message)
Default constructor with all context information.
|
StateTransition(State origin,
Message message,
State target)
Creates a new state transition with the given
origin and destination states after applying the message.
|
StateTransition(State origin,
Message message,
String target)
Creates a new state transition with the given
origin and destination state names after applying the message.
|
StateTransition(State origin,
String message,
State target)
Creates a new state transition with the given
origin and destination state names after applying the message.
|
StateTransition(State origin,
String message,
String target)
Creates a new state transition with the given
origin and destination state names after applying the message.
|
StateTransition(String origin,
Message message,
State target)
Creates a new state transition with the given
origin and destination state names after applying the message.
|
StateTransition(String origin,
String message,
State target)
Creates a new state transition with the given
origin and destination state names after applying the message.
|
| Constructor and Description |
|---|
SimpleEnvelope(State source,
Message message,
State target,
TransitionIndex<State,Message,StateTransition> transitionIndex) |
Copyright © 2019 state-machine. All rights reserved.