Is it somehow possible to implement a custom validator which handles both T
and Iterable<T>
objects, where T
is either primitive type or object?
The goal is to implement only a single ConstraintValidator object instead of two: *ConstraintValidator
and *ListConstraintValidator
Thank you in advance
Asked
Active
Viewed 81 times
1

nKognito
- 6,297
- 17
- 77
- 138
-
You can make T an `Object` and do some `instanceof` checks. But you can't handle primitive types. You have to go with the boxed versions. – Flown Nov 09 '15 at 06:30