public class TransitionImpl<E,S extends Enum<S>,C extends Context,D extends Data> extends Object implements Transition<E,S,C,D>
| Constructor and Description |
|---|
TransitionImpl(String description,
S to,
Class<E> event,
Predicate<E> guard,
Guard<E,C,D> richerGuard,
Consumer<E> action,
Action<E,C,D> statefulAction,
Function<E,?> transformation) |
| 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.
|
public boolean match(Object event, C ctx, D data)
Transitionpublic S getToState()
TransitionTransition represents the transition to
this particular state. Assuming the event matches of course.getToState in interface Transition<E,S extends Enum<S>,C extends Context,D extends Data>public Optional<Consumer<E>> getAction()
Transitionpublic Optional<Action<E,C,D>> getStatefulAction()
getStatefulAction in interface Transition<E,S extends Enum<S>,C extends Context,D extends Data>public Optional<Function<E,?>> getTransformation()
TransitionTransition. A transformation
may only exists if this is a transition out of a transient state.getTransformation in interface Transition<E,S extends Enum<S>,C extends Context,D extends Data>Transition out of a transient state.Copyright © 2019. All rights reserved.