@@ -63,12 +63,34 @@ protected Path createChildPath() {
63
63
64
64
public ValidatorGroup <T , V > build () {
65
65
66
- List <ValidatorGroup <V , ?>> groups = initAndBuildList (this .validatorGroupBuilders );
66
+ List <ValidatorGroup <V , ?>> groups = initAndBuildGroupList (this .validatorGroupBuilders );
67
67
List <Validator <V >> validators = initAndBuildList (this .validatorBuilders );
68
68
69
69
return new ValidatorGroup <>(validators , groups , valueGetter , conditionGetter );
70
70
}
71
71
72
+ // Note: exact same functionality as initAndBuildList, just needed a different call signature.
73
+ // This method was added to enable development using Eclipse
74
+ private List <ValidatorGroup <V , ?>> initAndBuildGroupList (List <ValidatorGroupBuilder <V , ?>> builders ) {
75
+
76
+ builders .forEach (builder -> {
77
+ if (Objects .nonNull (this .errorMessage )) {
78
+ builder .errorMessage (this .errorMessage );
79
+ }
80
+ if (Objects .isNull (builder .getBasePath ())) {
81
+ builder .basePath (createChildPath ());
82
+ }
83
+ if (Objects .isNull (builder .severity )) {
84
+ builder .severity (this .severity );
85
+ }
86
+ });
87
+ return builders .stream ()
88
+ .map (ValidatorBaseBuilder ::build )
89
+ .collect (Collectors .toList ());
90
+
91
+
92
+ }
93
+
72
94
private <U > List <U > initAndBuildList (List <? extends ValidatorBaseBuilder <V , U , ?>> builders ) {
73
95
74
96
builders .forEach (builder -> {
@@ -89,4 +111,4 @@ private <U> List<U> initAndBuildList(List<? extends ValidatorBaseBuilder<V, U, ?
89
111
90
112
}
91
113
92
- }
114
+ }
0 commit comments