diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/configurers/StateConfigurer.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/configurers/StateConfigurer.java index b98a9e69..c20d1659 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/configurers/StateConfigurer.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/config/configurers/StateConfigurer.java @@ -21,27 +21,98 @@ import java.util.Set; import org.springframework.statemachine.action.Action; import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; import org.springframework.statemachine.config.common.annotation.AnnotationConfigurerBuilder; +import org.springframework.statemachine.state.State; +/** + * Base {@code StateConfigurer} interface for configuring {@link State}s. + * + * @author Janne Valkealahti + * + * @param the type of state + * @param the type of event + */ public interface StateConfigurer extends AnnotationConfigurerBuilder> { + /** + * Specify a initial state {@code S}. + * + * @param initial the initial state + * @return configurer for chaining + */ StateConfigurer initial(S initial); + /** + * Specify a initial state {@code S} with an {@link Action} to be executed + * with it. Action can be i.e. used to init extended variables. + * + * @param initial the initial state + * @param action the action + * @return configurer for chaining + */ StateConfigurer initial(S initial, Action action); + /** + * Specify a states configured by this configurer instance to be + * substates of state {@code S}. + * + * @param state the parent state + * @return configurer for chaining + */ StateConfigurer parent(S state); + /** + * Specify a state {@code S}. + * + * @param state the state + * @return configurer for chaining + */ StateConfigurer state(S state); + /** + * Specify a state {@code S} with entry and exit {@link Actions}s. + * + * @param state the state + * @param entryActions the state entry actions + * @param exitActions the state exit actions + * @return configurer for chaining + */ StateConfigurer state(S state, Collection> entryActions, Collection> exitActions); + /** + * Specify a state {@code S} with entry and exit {@link Actions}. + * + * @param state the state + * @param entryAction the state entry action + * @param exitAction the state exit action + * @return configurer for chaining + */ StateConfigurer state(S state, Action entryAction, Action exitAction); + /** + * Specify a state {@code S} with a deferred events {@code E}. + * + * @param state the state + * @param deferred the deferred events + * @return configurer for chaining + */ StateConfigurer state(S state, E... deferred); + /** + * Specify a states {@code S}. + * + * @param states the states + * @return configurer for chaining + */ StateConfigurer states(Set states); + /** + * Specify a state {@code S} to be end state. + * + * @param end the end state + * @return configurer for chaining + */ StateConfigurer end(S end); }