Skip to content

Commit

Permalink
Add adders for easier adding for pre and post command interceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Oct 5, 2023
1 parent e94c78b commit 0fa1a92
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,14 @@ public List<CommandInterceptor> getCustomPreCommandInterceptors() {
return customPreCommandInterceptors;
}

public AbstractEngineConfiguration addCustomPreCommandInterceptor(CommandInterceptor commandInterceptor) {
if (this.customPreCommandInterceptors == null) {
this.customPreCommandInterceptors = new ArrayList<>();
}
this.customPreCommandInterceptors.add(commandInterceptor);
return this;
}

public AbstractEngineConfiguration setCustomPreCommandInterceptors(List<CommandInterceptor> customPreCommandInterceptors) {
this.customPreCommandInterceptors = customPreCommandInterceptors;
return this;
Expand All @@ -1457,6 +1465,14 @@ public List<CommandInterceptor> getCustomPostCommandInterceptors() {
return customPostCommandInterceptors;
}

public AbstractEngineConfiguration addCustomPostCommandInterceptor(CommandInterceptor commandInterceptor) {
if (this.customPostCommandInterceptors == null) {
this.customPostCommandInterceptors = new ArrayList<>();
}
this.customPostCommandInterceptors.add(commandInterceptor);
return this;
}

public AbstractEngineConfiguration setCustomPostCommandInterceptors(List<CommandInterceptor> customPostCommandInterceptors) {
this.customPostCommandInterceptors = customPostCommandInterceptors;
return this;
Expand Down

0 comments on commit 0fa1a92

Please sign in to comment.