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.ContextPredicate; | |
6 | ||
7 | import java.util.function.BiFunction; | |
8 | import java.util.function.Predicate; | |
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 MultiParamsContextPredicateBuilder { | |
15 | private final ContextVariable[] contextVariables; | |
16 | private final BiFunction<Predicate<?>, ContextVariable[], String> descriptionFormatter; | |
17 | ||
18 | public MultiParamsContextPredicateBuilder(ContextVariable... contextVariables) { | |
19 | this( | |
20 |
1
1. lambda$new$0 : replaced return value with "" for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextPredicateBuilder::lambda$new$0 → KILLED |
(Predicate<?> f, ContextVariable[] v) -> describeFunctionalObject(f, DEFAULT_PLACE_HOLDER_FORMATTER.apply(v), v), |
21 | contextVariables | |
22 | ); | |
23 | } | |
24 | ||
25 | private MultiParamsContextPredicateBuilder( | |
26 | BiFunction<Predicate<?>, ContextVariable[], String> descriptionFormatter, | |
27 | ContextVariable... contextVariables) { | |
28 | this.contextVariables = requireNonNull(contextVariables); | |
29 | this.descriptionFormatter = requireNonNull(descriptionFormatter); | |
30 | } | |
31 | ||
32 | public Predicate<Context> toContextPredicate(Predicate<Params> predicate) { | |
33 | requireNonNull(predicate); | |
34 |
1
1. toContextPredicate : replaced return value with null for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextPredicateBuilder::toContextPredicate → KILLED |
return new ContextPredicate.Impl( |
35 |
1
1. lambda$toContextPredicate$1 : replaced return value with "" for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextPredicateBuilder::lambda$toContextPredicate$1 → KILLED |
() -> descriptionFormatter.apply(predicate, contextVariables), |
36 |
2
1. lambda$toContextPredicate$2 : replaced boolean return with false for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextPredicateBuilder::lambda$toContextPredicate$2 → KILLED 2. lambda$toContextPredicate$2 : replaced boolean return with true for com/github/dakusui/actionunit/core/context/multiparams/MultiParamsContextPredicateBuilder::lambda$toContextPredicate$2 → KILLED |
(Context c) -> predicate.test(Params.create(c, contextVariables))); |
37 | } | |
38 | } | |
Mutations | ||
20 |
1.1 |
|
34 |
1.1 |
|
35 |
1.1 |
|
36 |
1.1 2.2 |