public interface TransitionBuilder<E,S extends Enum<S>,C extends Context,D extends Data>
| Modifier and Type | Method and Description |
|---|---|
Transition<E,S,C,D> |
build() |
TransitionBuilder<E,S,C,D> |
consume() |
TransitionBuilder<E,S,C,D> |
withAction(Action<E,C,D> action) |
TransitionBuilder<E,S,C,D> |
withAction(Consumer<E> action) |
TransitionBuilder<E,S,C,D> |
withGuard(Guard<E,C,D> guard) |
TransitionBuilder<E,S,C,D> |
withGuard(Predicate<E> guard) |
<R> TransitionBuilder<E,S,C,D> |
withTransformation(Function<E,R> transformation)
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.
|
TransitionBuilder<E,S,C,D> withGuard(Predicate<E> guard) throws IllegalStateException
guard - IllegalStateException - in case you are trying to specify a guard for a transition that
has been marked as a default transition (by definition, that "guard" is then accepting all)TransitionBuilder<E,S,C,D> withGuard(Guard<E,C,D> guard) throws IllegalStateException
guard - IllegalStateException - in case you are trying to specify a guard for a transition that
has been marked as a default transition (by definition, that "guard" is then accepting all)TransitionBuilder<E,S,C,D> consume()
<R> TransitionBuilder<E,S,C,D> withTransformation(Function<E,R> transformation) throws IllegalStateException
FSMBuilder.build()) so if you specify a transformation
on a Transition that go to a "regular" state, then it will not be detected until later at which time
an FSMBuilderException will be thrown.R - transformation - IllegalStateException - in case a transformation has already been specified.Transition<E,S,C,D> build()
Copyright © 2019. All rights reserved.