Class AbstractTransition<S,E>
java.lang.Object
org.springframework.statemachine.transition.AbstractTransition<S,E>
- Type Parameters:
S- the type of stateE- the type of event
- All Implemented Interfaces:
Transition<S,E>
- Direct Known Subclasses:
AbstractExternalTransition,AbstractInternalTransition,AbstractLocalTransition,InitialTransition
Base implementation of a
Transition.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTransition(State<S, E> source, State<S, E> target, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, E event, TransitionKind kind, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, Trigger<S, E> trigger) Instantiates a new abstract transition.AbstractTransition(State<S, E> source, State<S, E> target, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, E event, TransitionKind kind, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, Trigger<S, E> trigger, SecurityRule securityRule, String name) Instantiates a new abstract transition. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(ActionListener<S, E> listener) Adds the action listener.reactor.core.publisher.Mono<Void>executeTransitionActions(StateContext<S, E> context) Execute transition actions.Collection<Function<StateContext<S,E>, reactor.core.publisher.Mono<Void>>> Gets the transition actions.Function<StateContext<S,E>, reactor.core.publisher.Mono<Boolean>> getGuard()Gets the guard of this transition.getKind()Gets the transition kind.getName()Gets the name.Gets the security rule.Gets the source state of this transition.Gets the target state of this transition.Gets the transition trigger.voidremoveActionListener(ActionListener<S, E> listener) Removes the action listener.toString()reactor.core.publisher.Mono<Boolean>transit(StateContext<S, E> context) Transit this transition with a give state context.
-
Field Details
-
target
-
actions
-
-
Constructor Details
-
AbstractTransition
public AbstractTransition(State<S, E> source, State<S, E> target, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, E event, TransitionKind kind, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, Trigger<S, E> trigger) Instantiates a new abstract transition.- Parameters:
source- the sourcetarget- the targetactions- the actionsevent- the eventkind- the kindguard- the guardtrigger- the trigger
-
AbstractTransition
public AbstractTransition(State<S, E> source, State<S, E> target, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> actions, E event, TransitionKind kind, Function<StateContext<S, E>, reactor.core.publisher.Mono<Boolean>> guard, Trigger<S, E> trigger, SecurityRule securityRule, String name) Instantiates a new abstract transition.- Parameters:
source- the sourcetarget- the targetactions- the actionsevent- the eventkind- the kindguard- the guardtrigger- the triggersecurityRule- the security rule
-
-
Method Details
-
getSource
Description copied from interface:TransitionGets the source state of this transition.- Specified by:
getSourcein interfaceTransition<S,E> - Returns:
- the source state
-
getTrigger
Description copied from interface:TransitionGets the transition trigger.- Specified by:
getTriggerin interfaceTransition<S,E> - Returns:
- the transition trigger
-
transit
Description copied from interface:TransitionTransit this transition with a give state context.- Specified by:
transitin interfaceTransition<S,E> - Parameters:
context- the state context- Returns:
- Mono for completion with true, if transition happened, false otherwise
-
getGuard
Description copied from interface:TransitionGets the guard of this transition.- Specified by:
getGuardin interfaceTransition<S,E> - Returns:
- the guard
-
getKind
Description copied from interface:TransitionGets the transition kind.- Specified by:
getKindin interfaceTransition<S,E> - Returns:
- the transition kind
-
getSecurityRule
Description copied from interface:TransitionGets the security rule.- Specified by:
getSecurityRulein interfaceTransition<S,E> - Returns:
- the security rule
-
getTarget
Description copied from interface:TransitionGets the target state of this transition.- Specified by:
getTargetin interfaceTransition<S,E> - Returns:
- the target state
-
getName
Description copied from interface:TransitionGets the name.- Specified by:
getNamein interfaceTransition<S,E> - Returns:
- the name
-
getActions
Description copied from interface:TransitionGets the transition actions.- Specified by:
getActionsin interfaceTransition<S,E> - Returns:
- the transition actions
-
addActionListener
Description copied from interface:TransitionAdds the action listener.- Specified by:
addActionListenerin interfaceTransition<S,E> - Parameters:
listener- the listener
-
removeActionListener
Description copied from interface:TransitionRemoves the action listener.- Specified by:
removeActionListenerin interfaceTransition<S,E> - Parameters:
listener- the listener
-
executeTransitionActions
Description copied from interface:TransitionExecute transition actions.- Specified by:
executeTransitionActionsin interfaceTransition<S,E> - Parameters:
context- the state context- Returns:
- mono for completion
-
toString
-