@@ -44,7 +44,7 @@ public final class TypeHint implements ConditionalHint {
44
44
@ Nullable
45
45
private final TypeReference reachableType ;
46
46
47
- private final Set <FieldHint > fields ;
47
+ private final Set <String > fields ;
48
48
49
49
private final Set <ExecutableHint > constructors ;
50
50
@@ -57,7 +57,7 @@ private TypeHint(Builder builder) {
57
57
this .type = builder .type ;
58
58
this .reachableType = builder .reachableType ;
59
59
this .memberCategories = Set .copyOf (builder .memberCategories );
60
- this .fields = builder .fields . values (). stream (). map ( FieldHint . Builder :: build ). collect ( Collectors . toSet ()) ;
60
+ this .fields = builder .fields ;
61
61
this .constructors = builder .constructors .values ().stream ().map (ExecutableHint .Builder ::build ).collect (Collectors .toSet ());
62
62
this .methods = builder .methods .values ().stream ().map (ExecutableHint .Builder ::build ).collect (Collectors .toSet ());
63
63
}
@@ -89,10 +89,10 @@ public TypeReference getReachableType() {
89
89
90
90
/**
91
91
* Return the fields that require reflection.
92
- * @return a stream of {@link FieldHint}
92
+ * @return a stream of Strings
93
93
*/
94
- public Stream < FieldHint > fields () {
95
- return this .fields . stream () ;
94
+ public Set < String > fields () {
95
+ return this .fields ;
96
96
}
97
97
98
98
/**
@@ -147,7 +147,7 @@ public static class Builder {
147
147
@ Nullable
148
148
private TypeReference reachableType ;
149
149
150
- private final Map <String , FieldHint . Builder > fields = new HashMap <>();
150
+ private final Set <String > fields = new HashSet <>();
151
151
152
152
private final Map <ExecutableKey , ExecutableHint .Builder > constructors = new HashMap <>();
153
153
@@ -191,31 +191,9 @@ public Builder onReachableType(Class<?> reachableType) {
191
191
* @return {@code this}, to facilitate method chaining
192
192
*/
193
193
public Builder withField (String name ) {
194
- return withField (name , FieldMode . WRITE );
194
+ return withField (name );
195
195
}
196
196
197
- /**
198
- * Register the need for reflection on the field with the specified name
199
- * using the specified {@link FieldMode}.
200
- * @param name the name of the field
201
- * @param mode the requested mode
202
- * @return {@code this}, to facilitate method chaining
203
- */
204
- public Builder withField (String name , FieldMode mode ) {
205
- return withField (name , FieldHint .builtWith (mode ));
206
- }
207
-
208
- /**
209
- * Register the need for reflection on the field with the specified name.
210
- * @param name the name of the field
211
- * @param fieldHint a builder to further customize the hints of this field
212
- * @return {@code this}, to facilitate method chaining
213
- */
214
- public Builder withField (String name , Consumer <FieldHint .Builder > fieldHint ) {
215
- FieldHint .Builder builder = this .fields .computeIfAbsent (name , FieldHint .Builder ::new );
216
- fieldHint .accept (builder );
217
- return this ;
218
- }
219
197
220
198
/**
221
199
* Register the need for reflection on the constructor with the specified
0 commit comments