Interface StateMachineAccessor<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
public interface StateMachineAccessor<S,E>
Functional interface for
StateMachine
to allow more programmatic
access to underlying functionality. Functions prefixed "doWith" will expose
StateMachineAccess
via Consumer
for better functional
access with jdk8. Functions prefixed "with" is better suitable for lambdas.- Author:
- Janne Valkealahti
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doWithAllRegions
(Consumer<StateMachineAccess<S, E>> stateMachineAccess) Execute given function with all recursive regions.void
doWithRegion
(Consumer<StateMachineAccess<S, E>> stateMachineAccess) Execute given function with a region.Gets all regions.Get a region.
-
Method Details
-
doWithAllRegions
Execute given function with all recursive regions.- Parameters:
stateMachineAccess
- the state machine access
-
withAllRegions
List<StateMachineAccess<S,E>> withAllRegions()Gets all regions.- Returns:
- the all regions
-
doWithRegion
Execute given function with a region.- Parameters:
stateMachineAccess
- the state machine access
-
withRegion
StateMachineAccess<S,E> withRegion()Get a region.- Returns:
- the state machine access
-