public class TransitionBuilderImpl<E,S extends Enum<S>,C extends Context,D extends Data> extends Object implements TransitionBuilder<E,S,C,D>
| Constructor and Description |
|---|
TransitionBuilderImpl(S toState,
Class<E> event) |
TransitionBuilderImpl(S toState,
Class<E> event,
boolean isDefault) |
TransitionBuilderImpl(S toState,
Class<E> event,
boolean isDefault,
boolean isTransient) |
| Modifier and Type | Method and Description |
|---|---|
Transition<E,S,C,D> |
build() |
TransitionBuilder<E,S,C,D> |
consume()
An empty action will be installed that will just silently consume the event.
|
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.
|
public TransitionBuilder<E,S,C,D> consume()
public TransitionBuilder<E,S,C,D> withAction(Consumer<E> action)
withAction in interface TransitionBuilder<E,S extends Enum<S>,C extends Context,D extends Data>public TransitionBuilder<E,S,C,D> withAction(Action<E,C,D> action)
withAction in interface TransitionBuilder<E,S extends Enum<S>,C extends Context,D extends Data>public <R> TransitionBuilder<E,S,C,D> withTransformation(Function<E,R> transformation) throws IllegalStateException
TransitionBuilderFSMBuilder.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.withTransformation in interface TransitionBuilder<E,S extends Enum<S>,C extends Context,D extends Data>IllegalStateException - in case a transformation has already been specified.Copyright © 2019. All rights reserved.