Interface BuildableStateBuilder
public interface BuildableStateBuilder
Builder interface for configuring optional properties of State instances. This builder is
typically returned by mandatory builders and provides optional configuration.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the State instance with all configured properties.capabilities(Iterable<Capability> capabilities) Sets the capabilities for this state using an iterable collection.metaAttributes(Map<String, String> metaAttributes) Sets the meta attributes for this state.modifyTransition(TransitionId transitionId, Consumer<BuildableTransitionBuilder> transition) Modifies an existing transition in this state using the provided transition builder consumer.preFunctions(Iterable<Function> preFunctions) Sets the pre-functions for this state using an iterable collection.transitions(Iterable<Transition> transitions) Sets the transitions for this state using an iterable collection of pre-built transitions.withCommonTransition(TransitionId commonTransitionId) Sets the common transition IDs for this state using varargs.withoutTransition(TransitionId transitionId) Removes a transition from this state.withPostFunction(Consumer<FunctionBuilder> function) Adds a post-function to this state using the provided function builder consumer.withPreFunction(Consumer<FunctionBuilder> function) Adds a pre-function to this state using the provided function builder consumer.withTransition(Consumer<TransitionBuilder> transition) Adds a transition to this state using the provided transition builder consumer.
-
Method Details
-
capabilities
Sets the capabilities for this state using an iterable collection.- Parameters:
capabilities- the capabilities available in this state- Returns:
- this builder for method chaining
-
preFunctions
Sets the pre-functions for this state using an iterable collection.- Parameters:
preFunctions- the functions to execute when entering this state- Returns:
- this builder for method chaining
-
transitions
Sets the transitions for this state using an iterable collection of pre-built transitions.- Parameters:
transitions- the transitions available from this state- Returns:
- this builder for method chaining
-
withCommonTransition
Sets the common transition IDs for this state using varargs. Common transitions are available from multiple states.- Parameters:
commonTransitionId- the ID of common transition available from this state- Returns:
- this builder for method chaining
-
metaAttributes
Sets the meta attributes for this state.- Parameters:
metaAttributes- the metadata attributes for this state- Returns:
- this builder for method chaining
-
build
State build()Builds the State instance with all configured properties.- Returns:
- a new State instance
-
withTransition
Adds a transition to this state using the provided transition builder consumer.- Parameters:
transition- consumer to configure the transition- Returns:
- this builder for method chaining
-
withoutTransition
Removes a transition from this state.- Parameters:
transitionId- the ID of the transition to remove- Returns:
- this builder for method chaining
-
modifyTransition
BuildableStateBuilder modifyTransition(TransitionId transitionId, Consumer<BuildableTransitionBuilder> transition) Modifies an existing transition in this state using the provided transition builder consumer.- Parameters:
transitionId- the ID of the transition to modifytransition- consumer to configure the modified transition- Returns:
- this builder for method chaining
-
withPreFunction
Adds a pre-function to this state using the provided function builder consumer.- Parameters:
function- consumer to configure the pre-function- Returns:
- this builder for method chaining
-
withPostFunction
Adds a post-function to this state using the provided function builder consumer.- Parameters:
function- consumer to configure the post-function- Returns:
- this builder for method chaining
-