1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -176,6 +176,19 @@ public GeneratedClass addForFeatureComponent(String featureName,
176
176
return addForFeatureComponent (featureName , ClassName .get (targetComponent ), type );
177
177
}
178
178
179
+ /**
180
+ * Create a new {@link GeneratedClasses} instance using the specified feature
181
+ * name prefix to qualify generated class names for a dedicated round of code
182
+ * generation.
183
+ * @param featureNamePrefix the feature name prefix to use
184
+ * @return a new instance for the specified feature name prefix
185
+ * @since 6.0.12
186
+ */
187
+ public GeneratedClasses withFeatureNamePrefix (String featureNamePrefix ) {
188
+ return new GeneratedClasses (this .classNameGenerator .withFeatureNamePrefix (featureNamePrefix ),
189
+ this .classes , this .classesByOwner );
190
+ }
191
+
179
192
private GeneratedClass createAndAddGeneratedClass (String featureName ,
180
193
@ Nullable ClassName targetComponent , Consumer <TypeSpec .Builder > type ) {
181
194
@@ -199,11 +212,6 @@ void writeTo(GeneratedFiles generatedFiles) {
199
212
}
200
213
}
201
214
202
- GeneratedClasses withFeatureNamePrefix (String name ) {
203
- return new GeneratedClasses (this .classNameGenerator .withFeatureNamePrefix (name ),
204
- this .classes , this .classesByOwner );
205
- }
206
-
207
215
private record Owner (String featureNamePrefix , String featureName , @ Nullable ClassName target ) {
208
216
}
209
217
0 commit comments