Class TransitionsBuilderImpl<S,E,C>
- java.lang.Object
-
- com.alibaba.cola.statemachine.builder.TransitionsBuilderImpl<S,E,C>
-
- All Implemented Interfaces:
ExternalTransitionBuilder<S,E,C>,ExternalTransitionsBuilder<S,E,C>,From<S,E,C>,InternalTransitionBuilder<S,E,C>,On<S,E,C>,To<S,E,C>,When<S,E,C>
public class TransitionsBuilderImpl<S,E,C> extends Object implements ExternalTransitionsBuilder<S,E,C>
TransitionsBuilderImpl- Author:
- Frank Zhang
-
-
Constructor Summary
Constructors Constructor Description TransitionsBuilderImpl(Map<S,State<S,E,C>> stateMap, TransitionType transitionType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description From<S,E,C>from(S stateId)Build transition source state.From<S,E,C>fromAmong(S... stateIds)On<S,E,C>on(E event)Build transition eventvoidperform(Action<S,E,C> action)Define action to be performed during transitionTo<S,E,C>to(S stateId)Build transition target state and return to clause builderWhen<S,E,C>when(Condition<C> condition)Add condition for the transitionTo<S,E,C>within(S stateId)Build a internal transition
-
-
-
Field Detail
-
target
protected State<S,E,C> target
-
-
Method Detail
-
fromAmong
public From<S,E,C> fromAmong(S... stateIds)
- Specified by:
fromAmongin interfaceExternalTransitionsBuilder<S,E,C>
-
when
public When<S,E,C> when(Condition<C> condition)
Description copied from interface:OnAdd condition for the transition
-
perform
public void perform(Action<S,E,C> action)
Description copied from interface:WhenDefine action to be performed during transition
-
from
public From<S,E,C> from(S stateId)
Description copied from interface:ExternalTransitionBuilderBuild transition source state.- Specified by:
fromin interfaceExternalTransitionBuilder<S,E,C>- Parameters:
stateId- id of state- Returns:
- from clause builder
-
to
public To<S,E,C> to(S stateId)
Description copied from interface:FromBuild transition target state and return to clause builder
-
within
public To<S,E,C> within(S stateId)
Description copied from interface:InternalTransitionBuilderBuild a internal transition- Specified by:
withinin interfaceInternalTransitionBuilder<S,E,C>- Parameters:
stateId- id of transition- Returns:
- To clause builder
-
-