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
.- Author:
- Janne Valkealahti
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractTransition
(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 TypeMethodDescriptionvoid
addActionListener
(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.void
removeActionListener
(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:Transition
Gets the source state of this transition.- Specified by:
getSource
in interfaceTransition<S,
E> - Returns:
- the source state
-
getTrigger
Description copied from interface:Transition
Gets the transition trigger.- Specified by:
getTrigger
in interfaceTransition<S,
E> - Returns:
- the transition trigger
-
transit
Description copied from interface:Transition
Transit this transition with a give state context.- Specified by:
transit
in interfaceTransition<S,
E> - Parameters:
context
- the state context- Returns:
- Mono for completion with true, if transition happened, false otherwise
-
getGuard
Description copied from interface:Transition
Gets the guard of this transition.- Specified by:
getGuard
in interfaceTransition<S,
E> - Returns:
- the guard
-
getKind
Description copied from interface:Transition
Gets the transition kind.- Specified by:
getKind
in interfaceTransition<S,
E> - Returns:
- the transition kind
-
getSecurityRule
Description copied from interface:Transition
Gets the security rule.- Specified by:
getSecurityRule
in interfaceTransition<S,
E> - Returns:
- the security rule
-
getTarget
Description copied from interface:Transition
Gets the target state of this transition.- Specified by:
getTarget
in interfaceTransition<S,
E> - Returns:
- the target state
-
getName
Description copied from interface:Transition
Gets the name.- Specified by:
getName
in interfaceTransition<S,
E> - Returns:
- the name
-
getActions
Description copied from interface:Transition
Gets the transition actions.- Specified by:
getActions
in interfaceTransition<S,
E> - Returns:
- the transition actions
-
addActionListener
Description copied from interface:Transition
Adds the action listener.- Specified by:
addActionListener
in interfaceTransition<S,
E> - Parameters:
listener
- the listener
-
removeActionListener
Description copied from interface:Transition
Removes the action listener.- Specified by:
removeActionListener
in interfaceTransition<S,
E> - Parameters:
listener
- the listener
-
executeTransitionActions
Description copied from interface:Transition
Execute transition actions.- Specified by:
executeTransitionActions
in interfaceTransition<S,
E> - Parameters:
context
- the state context- Returns:
- mono for completion
-
toString
-