@@ -60,8 +60,8 @@ public abstract class ArchitecturallyEvidentType {
60
60
private final @ Getter JavaClass type ;
61
61
62
62
/**
63
- * Creates a new {@link ArchitecturallyEvidentType} for the given {@link JavaType} and {@link Classes} of
64
- * Spring components.
63
+ * Creates a new {@link ArchitecturallyEvidentType} for the given {@link JavaType} and {@link Classes} of Spring
64
+ * components.
65
65
*
66
66
* @param type must not be {@literal null}.
67
67
* @param beanTypes must not be {@literal null}.
@@ -102,7 +102,7 @@ String getAbbreviatedFullName() {
102
102
* @return
103
103
*/
104
104
boolean isEntity () {
105
- return isJpaEntity ().apply (getType ());
105
+ return isJpaEntity ().test (getType ());
106
106
}
107
107
108
108
/**
@@ -181,8 +181,8 @@ static class SpringAwareArchitecturallyEvidentType extends ArchitecturallyEviden
181
181
* Methods (meta-)annotated with @EventListener.
182
182
*/
183
183
private static final Predicate <JavaMethod > IS_ANNOTATED_EVENT_LISTENER = it -> //
184
- Types .isAnnotatedWith (SpringTypes .AT_EVENT_LISTENER ).apply (it ) //
185
- || Types .isAnnotatedWith (SpringTypes .AT_TX_EVENT_LISTENER ).apply (it );
184
+ Types .isAnnotatedWith (SpringTypes .AT_EVENT_LISTENER ).test (it ) //
185
+ || Types .isAnnotatedWith (SpringTypes .AT_TX_EVENT_LISTENER ).test (it );
186
186
187
187
/**
188
188
* {@code ApplicationListener.onApplicationEvent(…)}
@@ -214,7 +214,7 @@ public boolean isAggregateRoot() {
214
214
*/
215
215
@ Override
216
216
public boolean isRepository () {
217
- return Types .isAnnotatedWith (SpringTypes .AT_REPOSITORY ).apply (getType ());
217
+ return Types .isAnnotatedWith (SpringTypes .AT_REPOSITORY ).test (getType ());
218
218
}
219
219
220
220
/*
@@ -223,7 +223,7 @@ public boolean isRepository() {
223
223
*/
224
224
@ Override
225
225
public boolean isService () {
226
- return Types .isAnnotatedWith (SpringTypes .AT_SERVICE ).apply (getType ());
226
+ return Types .isAnnotatedWith (SpringTypes .AT_SERVICE ).test (getType ());
227
227
}
228
228
229
229
/*
@@ -232,7 +232,7 @@ public boolean isService() {
232
232
*/
233
233
@ Override
234
234
public boolean isController () {
235
- return Types .isAnnotatedWith (SpringTypes .AT_CONTROLLER ).apply (getType ());
235
+ return Types .isAnnotatedWith (SpringTypes .AT_CONTROLLER ).test (getType ());
236
236
}
237
237
238
238
/*
@@ -250,7 +250,7 @@ public boolean isEventListener() {
250
250
*/
251
251
@ Override
252
252
public boolean isConfigurationProperties () {
253
- return Types .isAnnotatedWith (SpringTypes .AT_CONFIGURATION_PROPERTIES ).apply (getType ());
253
+ return Types .isAnnotatedWith (SpringTypes .AT_CONFIGURATION_PROPERTIES ).test (getType ());
254
254
}
255
255
256
256
/*
@@ -329,7 +329,7 @@ public boolean isAggregateRoot() {
329
329
*/
330
330
@ Override
331
331
public boolean isRepository () {
332
- return SpringDataTypes .isSpringDataRepository ().apply (getType ());
332
+ return SpringDataTypes .isSpringDataRepository ().test (getType ());
333
333
}
334
334
335
335
/*
@@ -338,14 +338,15 @@ public boolean isRepository() {
338
338
*/
339
339
@ Override
340
340
public boolean isController () {
341
- return Types .isAnnotatedWith ("org.springframework.data.rest.webmvc.BasePathAwareController" ).apply (getType ());
341
+ return Types .isAnnotatedWith ("org.springframework.data.rest.webmvc.BasePathAwareController" )
342
+ .test (getType ());
342
343
}
343
344
}
344
345
345
346
static class JMoleculesArchitecturallyEvidentType extends ArchitecturallyEvidentType {
346
347
347
348
private static final Predicate <JavaMethod > IS_ANNOTATED_EVENT_LISTENER = Types
348
- .isAnnotatedWith (JMoleculesTypes .AT_DOMAIN_EVENT_HANDLER )::apply ;
349
+ .isAnnotatedWith (JMoleculesTypes .AT_DOMAIN_EVENT_HANDLER )::test ;
349
350
350
351
JMoleculesArchitecturallyEvidentType (JavaClass type ) {
351
352
super (type );
@@ -360,7 +361,7 @@ public boolean isEntity() {
360
361
361
362
JavaClass type = getType ();
362
363
363
- return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Entity .class ).apply (type ) || //
364
+ return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Entity .class ).test (type ) || //
364
365
type .isAssignableTo (org .jmolecules .ddd .types .Entity .class );
365
366
}
366
367
@@ -373,7 +374,7 @@ public boolean isAggregateRoot() {
373
374
374
375
JavaClass type = getType ();
375
376
376
- return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .AggregateRoot .class ).apply (type ) //
377
+ return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .AggregateRoot .class ).test (type ) //
377
378
|| type .isAssignableTo (org .jmolecules .ddd .types .AggregateRoot .class );
378
379
}
379
380
@@ -386,7 +387,7 @@ public boolean isRepository() {
386
387
387
388
JavaClass type = getType ();
388
389
389
- return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Repository .class ).apply (type )
390
+ return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Repository .class ).test (type )
390
391
|| type .isAssignableTo (org .jmolecules .ddd .types .Repository .class );
391
392
}
392
393
@@ -399,7 +400,7 @@ public boolean isService() {
399
400
400
401
JavaClass type = getType ();
401
402
402
- return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Service .class ).apply (type );
403
+ return Types .isAnnotatedWith (org .jmolecules .ddd .annotation .Service .class ).test (type );
403
404
}
404
405
405
406
/*
@@ -414,15 +415,18 @@ public boolean isEventListener() {
414
415
415
416
static class DelegatingType extends ArchitecturallyEvidentType {
416
417
417
- private final Supplier <Boolean > isAggregateRoot , isRepository , isEntity , isService , isController , isEventListener ,
418
+ private final Supplier <Boolean > isAggregateRoot , isRepository , isEntity , isService , isController ,
419
+ isEventListener ,
418
420
isConfigurationProperties ;
419
421
private final Supplier <Collection <JavaClass >> referenceTypes ;
420
422
private final Supplier <Collection <ReferenceMethod >> referenceMethods ;
421
423
422
424
DelegatingType (JavaClass type , Supplier <Boolean > isAggregateRoot ,
423
425
Supplier <Boolean > isRepository , Supplier <Boolean > isEntity , Supplier <Boolean > isService ,
424
- Supplier <Boolean > isController , Supplier <Boolean > isEventListener , Supplier <Boolean > isConfigurationProperties ,
425
- Supplier <Collection <JavaClass >> referenceTypes , Supplier <Collection <ReferenceMethod >> referenceMethods ) {
426
+ Supplier <Boolean > isController , Supplier <Boolean > isEventListener ,
427
+ Supplier <Boolean > isConfigurationProperties ,
428
+ Supplier <Collection <JavaClass >> referenceTypes ,
429
+ Supplier <Collection <ReferenceMethod >> referenceMethods ) {
426
430
427
431
super (type );
428
432
0 commit comments