public interface Transition<E,S extends Enum<S>,C extends Context,D extends Data>
State, it will
match that event against all its Transitions and if one
matches, the FSM will transition fo the new state.
Note: in the current model, a Transition always live in
the context of a State and as such, there is no need to
keep track of the from state in this class (which is why only
getToState() exists)| Modifier and Type | Method and Description |
|---|---|
Optional<Consumer<E>> |
getAction()
Get the associated action wih this transition, if it exists.
|
Optional<Action<E,C,D>> |
getStatefulAction() |
S |
getToState()
This
Transition represents the transition to
this particular state. |
Optional<Function<E,?>> |
getTransformation()
Get the transformation associated with this
Transition. |
boolean |
match(Object event,
C ctx,
D data)
See if the given event is matching this transition.
|
boolean match(Object event, C ctx, D data)
event - the event to match agianst this transition.S getToState()
Transition represents the transition to
this particular state. Assuming the event matches of course.Optional<Consumer<E>> getAction()
Optional<Function<E,?>> getTransformation()
Transition. A transformation
may only exists if this is a transition out of a transient state.Transition out of a transient state.Copyright © 2019. All rights reserved.