Add methods in KiwiConstraintViolations to convert constraint violations to maps #1169
Labels
new feature
A new feature such as a new class, method, package, group of classes, etc.
Milestone
Add methods in
KiwiConstraintViolations
to convertSet<ConstraintViolation<T>
to JDKMap
and GuavaMultimap
.Specifically, methods to convert a set of constraint violations to:
Map<String, ConstraintViolation<T>>
assuming there can only be a single violation per property. Throw anIllegalStateException
if more than one violation for a property.Map<String, ConstraintViolation<T>>
, ignoring more than one violation per property and taking the last violation when there is more than one for a property.Map<String, Set<ConstraintViolation<T>>>
allowing for one or more violation per property.Multimap<String, ConstraintViolation<T>>
allowing for one or more violation per property.There can be overloads of each of the above that accept a
Function<Path, String>
that specifies how to transform a propertyPath
to aString
. The default implementations can simply usePath::toString
.The text was updated successfully, but these errors were encountered: