hierarchical-validation-baseline #59

Merged
hsh-michaelhoennig merged 18 commits from hierarchical-validation-baseline into master 2024-06-14 16:48:01 +02:00
2 changed files with 2 additions and 8 deletions
Showing only changes of commit d7b7d91392 - Show all commits

View File

@ -42,7 +42,7 @@ public class HsBookingItemEntityValidator extends HsEntityValidator<HsBookingIte
).filter(Objects::nonNull).toList(); ).filter(Objects::nonNull).toList();
} }
// FIXME: convert into generic shape like multi-options validator // TODO.refa: convert into generic shape like multi-options validator
private static String validateMaxTotalValue( private static String validateMaxTotalValue(
final HsBookingItemEntity bookingItem, final HsBookingItemEntity bookingItem,
final ValidatableProperty<?> propDef) { final ValidatableProperty<?> propDef) {

View File

@ -22,7 +22,7 @@ public abstract class HsEntityValidator<E> {
protected static List<String> enrich(final String prefix, final List<String> messages) { protected static List<String> enrich(final String prefix, final List<String> messages) {
return messages.stream() return messages.stream()
// FIXME: this is a bit hacky, I need to find the right place to add the prefix // TODO:refa: this is a bit hacky, I need to find the right place to add the prefix
.map(message -> message.startsWith("'") ? message : ("'" + prefix + "." + message)) .map(message -> message.startsWith("'") ? message : ("'" + prefix + "." + message))
.toList(); .toList();
} }
@ -52,12 +52,6 @@ public abstract class HsEntityValidator<E> {
return result; return result;
} }
protected List<String> validateParentEntities(final HsBookingItemEntity bookingItem) {
return bookingItem.getParentItem() != null ?
HsBookingItemEntityValidatorRegistry.doValidate(bookingItem.getParentItem()) :
emptyList();
}
@SafeVarargs @SafeVarargs
protected static List<String> sequentiallyValidate(final Supplier<List<String>>... validators) { protected static List<String> sequentiallyValidate(final Supplier<List<String>>... validators) {
return new ArrayList<>(stream(validators) return new ArrayList<>(stream(validators)