-
Notifications
You must be signed in to change notification settings - Fork 52
fix #1252: Add predictable naming to tasks instead of UUIDs #1253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,6 @@ | |
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
| import java.util.UUID; | ||
| import java.util.function.Consumer; | ||
|
|
||
| /** | ||
|
|
@@ -35,6 +34,17 @@ | |
| */ | ||
| public abstract class BaseTaskItemListBuilder<SELF extends BaseTaskItemListBuilder<SELF>> { | ||
|
|
||
| protected final String TYPE_SET = "set"; | ||
| protected final String TYPE_FOR = "for"; | ||
| protected final String TYPE_SWITCH = "switch"; | ||
| protected final String TYPE_RAISE = "raise"; | ||
| protected final String TYPE_FORK = "fork"; | ||
| protected final String TYPE_LISTEN = "listen"; | ||
| protected final String TYPE_EMIT = "emit"; | ||
| protected final String TYPE_TRY = "try"; | ||
| protected final String TYPE_HTTP = "http"; | ||
| protected final String TYPE_OPENAPI = "openapi"; | ||
|
|
||
| private final List<TaskItem> list; | ||
|
|
||
| public BaseTaskItemListBuilder() { | ||
|
|
@@ -59,11 +69,14 @@ protected final SELF addTaskItem(TaskItem taskItem) { | |
| return self(); | ||
| } | ||
|
|
||
| protected final String defaultNameAndRequireConfig(String name, Consumer<?> cfg) { | ||
| protected final String defaultNameAndRequireConfig( | ||
| String name, Consumer<?> cfg, String taskType) { | ||
| Objects.requireNonNull(cfg, "Configurer must not be null"); | ||
|
|
||
| if (name == null || name.isBlank()) { | ||
| name = UUID.randomUUID().toString(); | ||
| return taskType + "-" + this.list.size(); | ||
| } | ||
ricardozanini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Objects.requireNonNull(cfg, "Configurer must not be null"); | ||
|
|
||
| return name; | ||
|
Comment on lines
+72
to
80
|
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.