1 | package com.github.dakusui.actionunit.core.context.multiparams; | |
2 | ||
3 | import com.github.dakusui.actionunit.actions.ContextVariable; | |
4 | import com.github.dakusui.actionunit.core.Context; | |
5 | import com.github.dakusui.actionunit.core.context.ContextConsumer; | |
6 | ||
7 | import java.util.function.BiFunction; | |
8 | import java.util.function.Consumer; | |
9 | ||
10 | import static com.github.dakusui.actionunit.actions.cmd.PlaceHolderFormatter.DEFAULT_PLACE_HOLDER_FORMATTER; | |
11 | import static com.github.dakusui.actionunit.core.context.ContextFunctions.describeFunctionalObject; | |
12 | import static java.util.Objects.requireNonNull; | |
13 | ||
14 | public class MultiParamsContextConsumerBuilder { | |
15 | private final ContextVariable[] contextVariables; | |
16 | private final BiFunction<Consumer<?>, ContextVariable[], String> descriptionFormatter; | |
17 | ||
18 | public MultiParamsContextConsumerBuilder(ContextVariable... contextVariables) { | |
19 | this( | |
20 |
1
1. lambda$new$0 : replaced return value with "" for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextConsumerBuilder::lambda$new$0 → KILLED |
(Consumer<?> f, ContextVariable[] v) -> describeFunctionalObject(f, DEFAULT_PLACE_HOLDER_FORMATTER.apply(v), v), |
21 | contextVariables | |
22 | ); | |
23 | } | |
24 | ||
25 | private MultiParamsContextConsumerBuilder( | |
26 | BiFunction<Consumer<?>, ContextVariable[], String> descriptionFormatter, | |
27 | ContextVariable... contextVariables) { | |
28 | this.contextVariables = requireNonNull(contextVariables); | |
29 | this.descriptionFormatter = requireNonNull(descriptionFormatter); | |
30 | } | |
31 | ||
32 | public Consumer<Context> toContextConsumer(Consumer<Params> consumer) { | |
33 | requireNonNull(consumer); | |
34 |
1
1. toContextConsumer : replaced return value with null for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextConsumerBuilder::toContextConsumer → KILLED |
return new ContextConsumer.Impl( |
35 |
1
1. lambda$toContextConsumer$1 : replaced return value with "" for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextConsumerBuilder::lambda$toContextConsumer$1 → KILLED |
() -> descriptionFormatter.apply(consumer, contextVariables), |
36 |
1
1. lambda$toContextConsumer$2 : removed call to java/util/function/Consumer::accept → KILLED |
(Context c) -> consumer.accept(Params.create(c, contextVariables)) |
37 | ); | |
38 | } | |
39 | } | |
Mutations | ||
20 |
1.1 |
|
34 |
1.1 |
|
35 |
1.1 |
|
36 |
1.1 |