1 | package com.github.dakusui.osynth.core; | |
2 | ||
3 | import static com.github.dakusui.osynth.core.utils.MethodUtils.createMethodHandlerDelegatingToObject; | |
4 | import static com.github.dakusui.valid8j.Requires.requireNonNull; | |
5 | ||
6 | public interface MethodHandlerEntry { | |
7 | MethodMatcher matcher(); | |
8 | ||
9 | MethodHandler handler(); | |
10 | ||
11 | boolean isBuiltIn(); | |
12 | ||
13 | static MethodHandlerEntry create(MethodMatcher matcher, MethodHandler handler, boolean isBuiltIn) { | |
14 | requireNonNull(matcher); | |
15 | requireNonNull(handler); | |
16 |
1
1. create : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry::create → KILLED |
return new MethodHandlerEntry() { |
17 | @Override | |
18 | public MethodMatcher matcher() { | |
19 |
1
1. matcher : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$1::matcher → KILLED |
return matcher; |
20 | } | |
21 | ||
22 | @Override | |
23 | public MethodHandler handler() { | |
24 |
1
1. handler : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$1::handler → KILLED |
return handler; |
25 | } | |
26 | ||
27 | @Override | |
28 | public boolean isBuiltIn() { | |
29 |
2
1. isBuiltIn : replaced boolean return with false for com/github/dakusui/osynth/core/MethodHandlerEntry$1::isBuiltIn → KILLED 2. isBuiltIn : replaced boolean return with true for com/github/dakusui/osynth/core/MethodHandlerEntry$1::isBuiltIn → KILLED |
return isBuiltIn; |
30 | } | |
31 | ||
32 | @Override | |
33 | public String toString() { | |
34 |
1
1. toString : replaced return value with "" for com/github/dakusui/osynth/core/MethodHandlerEntry$1::toString → KILLED |
return String.format("(%s,%s)", matcher, handler); |
35 | } | |
36 | }; | |
37 | } | |
38 | ||
39 | class Builder { | |
40 | MethodHandler handler; | |
41 | private MethodMatcher matcher; | |
42 | ||
43 | public Builder() { | |
44 | } | |
45 | ||
46 | public Builder matcher(MethodMatcher matcher) { | |
47 | this.matcher = requireNonNull(matcher); | |
48 |
1
1. matcher : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::matcher → KILLED |
return this; |
49 | } | |
50 | ||
51 | public Builder handler(MethodHandler handler) { | |
52 | this.handler = requireNonNull(handler); | |
53 |
1
1. handler : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::handler → KILLED |
return this; |
54 | } | |
55 | ||
56 | public MethodHandlerEntry build() { | |
57 |
1
1. build : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::build → KILLED |
return create(this.matcher, handler, false); |
58 | } | |
59 | ||
60 | public MethodHandlerEntry with(MethodHandler handler) { | |
61 |
1
1. with : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::with → KILLED |
return this.handler(handler).build(); |
62 | } | |
63 | ||
64 | public MethodHandlerEntry delegatingTo(Object object) { | |
65 | requireNonNull(object); | |
66 |
2
1. delegatingTo : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::delegatingTo → KILLED 2. lambda$delegatingTo$0 : replaced return value with null for com/github/dakusui/osynth/core/MethodHandlerEntry$Builder::lambda$delegatingTo$0 → KILLED |
return this.handler((synthesizedObject, args) -> createMethodHandlerDelegatingToObject( |
67 | object, | |
68 | MethodSignature.create(InvocationController.invocationContext().invokedMethod())).handle(synthesizedObject, args)) | |
69 | .build(); | |
70 | } | |
71 | } | |
72 | } | |
Mutations | ||
16 |
1.1 |
|
19 |
1.1 |
|
24 |
1.1 |
|
29 |
1.1 2.2 |
|
34 |
1.1 |
|
48 |
1.1 |
|
53 |
1.1 |
|
57 |
1.1 |
|
61 |
1.1 |
|
66 |
1.1 2.2 |