public class ModelBuilder
extends java.lang.Object
Model, in a fluent way.| Constructor and Description |
|---|
ModelBuilder(Model model) |
| Modifier and Type | Method and Description |
|---|---|
Model |
build()
Returns the model built so far.
|
FlowlessConditionPart |
condition(Condition condition)
Only if the specified condition is true, the message is handled.
|
<T> FlowlessUserPart<T> |
on(java.lang.Class<T> messageClass)
Creates a handler for messages or exceptions of the specified type.
|
FlowlessStepPart |
step(java.lang.String stepName)
Creates a named step.
|
UseCasePart |
useCase(java.lang.String useCaseName)
Creates a new use case in the current model, and returns a part for building
its details.
|
<T> FlowlessUserPart<T> |
user(java.lang.Class<T> commandClass)
Creates a handler for commands of the specified type.
|
public ModelBuilder(Model model)
public FlowlessConditionPart condition(Condition condition)
condition - the condition that constrains when the message is handledpublic FlowlessStepPart step(java.lang.String stepName)
stepName - the name of the created steppublic <T> FlowlessUserPart<T> user(java.lang.Class<T> commandClass)
Internally, a default use case ("Handles messages") is created in the model.
T - the type of commandcommandClass - the specified command classpublic <T> FlowlessUserPart<T> on(java.lang.Class<T> messageClass)
Internally, a default use case ("Handles messages") is created in the model.
T - the type of messagesmessageClass - the specified type of messagespublic UseCasePart useCase(java.lang.String useCaseName)
useCaseName - the name of the existing use case / use case to be
created.public Model build()