File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
spring-modulith-core/src/main/java/org/springframework/modulith/model Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ public static ApplicationModules of(Class<?> modulithType) {
121
121
/**
122
122
* Creates a new {@link ApplicationModules} relative to the given modulith type, a
123
123
* {@link ApplicationModuleDetectionStrategy} and a {@link DescribedPredicate} which types and packages to ignore.
124
- * Will inspect the {@link Modulith} and {@link Modulithic} annotations on the class given for advanced
125
- * customizations of the module setup.
124
+ * Will inspect the {@link Modulith} and {@link Modulithic} annotations on the class given for advanced customizations
125
+ * of the module setup.
126
126
*
127
127
* @param modulithType must not be {@literal null}.
128
128
* @param detection must not be {@literal null}.
@@ -280,19 +280,33 @@ public Optional<ApplicationModule> getModuleForPackage(String name) {
280
280
.findFirst ();
281
281
}
282
282
283
- public void verify () {
283
+ /**
284
+ * Execute all verifications to be applied, unless the verifcation has been executed before.
285
+ *
286
+ * @return will never be {@literal null}.
287
+ */
288
+ public ApplicationModules verify () {
284
289
285
290
if (verified ) {
286
- return ;
291
+ return this ;
287
292
}
288
293
289
294
Violations violations = detectViolations ();
290
295
291
296
this .verified = true ;
292
297
293
298
violations .throwIfPresent ();
299
+
300
+ return this ;
294
301
}
295
302
303
+ /**
304
+ * Executes all verifications to be applied and returns {@link Violations} if any occured. Will always execute the
305
+ * verifications in contrast to {@link #verify()} which just runs once.
306
+ *
307
+ * @return will never be {@literal null}.
308
+ * @see Violations#throwIfPresent()
309
+ */
296
310
public Violations detectViolations () {
297
311
298
312
Violations violations = rootPackages .stream () //
You can’t perform that action at this time.
0 commit comments