Package io.hektor.fsm.builder.impl
Class TransitionBuilderImpl<E,S extends Enum<S>,C extends Context,D extends Data>
java.lang.Object
io.hektor.fsm.builder.impl.TransitionBuilderImpl<E,S,C,D>
- All Implemented Interfaces:
TransitionBuilder<E,S, C, D>
public class TransitionBuilderImpl<E,S extends Enum<S>,C extends Context,D extends Data>
extends Object
implements TransitionBuilder<E,S,C,D>
- Author:
- jonas@jonasborjesson.com
-
Constructor Summary
ConstructorsConstructorDescriptionTransitionBuilderImpl(S toState, Class<E> event) TransitionBuilderImpl(S toState, Class<E> event, boolean isDefault) TransitionBuilderImpl(S toState, Class<E> event, boolean isDefault, boolean isTransient) -
Method Summary
Modifier and TypeMethodDescriptionTransition<E,S, C, D> build()withAction(Consumer<E> action, Label label) <R> TransitionBuilder<E,S, C, D> withTransformation(Function<E, R> transformation, Label label) For transitions to a transient state, you can optionally specify a transformation that will be applied to the original event before entering the state you're automatically transitioning to.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.hektor.fsm.builder.TransitionBuilder
consume, withAction, withAction, withGuard, withGuard, withTransformation
-
Constructor Details
-
TransitionBuilderImpl
-
TransitionBuilderImpl
-
TransitionBuilderImpl
-
-
Method Details
-
withGuard
-
withGuard
-
withAction
- Specified by:
withActionin interfaceTransitionBuilder<E,S extends Enum<S>, C extends Context, D extends Data>
-
withAction
- Specified by:
withActionin interfaceTransitionBuilder<E,S extends Enum<S>, C extends Context, D extends Data>
-
withTransformation
public <R> TransitionBuilder<E,S, withTransformationC, D> (Function<E, R> transformation, Label label) throws IllegalStateExceptionDescription copied from interface:TransitionBuilderFor transitions to a transient state, you can optionally specify a transformation that will be applied to the original event before entering the state you're automatically transitioning to. NOTE: the validation that the target state is indeed a transient state cannot be performed until the actual state machine definition is built (FSMBuilder.build()) so if you specify a transformation on aTransitionthat go to a "regular" state, then it will not be detected until later at which time anFSMBuilderExceptionwill be thrown.- Specified by:
withTransformationin interfaceTransitionBuilder<E,S extends Enum<S>, C extends Context, D extends Data> - Returns:
- Throws:
IllegalStateException- in case a transformation has already been specified.
-
build
-