<div dir="ltr">Hi,<div><br></div><div>As you may have seen, Emmanuel started a survey on how people would like to use type-level constraints in Bean Validation: <a href="http://beanvalidation.org/news/2016/11/23/survey-constraints-and-parameterized-type/">http://beanvalidation.org/news/2016/11/23/survey-constraints-and-parameterized-type/</a></div><div><br></div><div>While we are waiting for some more replies to that one, I started with a PoC implementation of the value extractor idea in the reference implementation in order to get a better feeling for it, it&#39;s limitations, open questions etc.: <a href="https://github.com/hibernate/hibernate-validator/pull/592">https://github.com/hibernate/hibernate-validator/pull/592</a></div><div><br></div><div>One thing we started to wonder is whether it should be allowed to put type-level constraints to a field *and* the corresponding property getter at the same time:</div><div><br></div><div>    private List&lt;@NotBlank String&gt; strings;</div><div><br></div><div>    public List&lt;@Pattern(regexp=&quot;...&quot;) String&gt; getStrings() { return strings; }</div><div><br></div><div>My first inclination was to say that it should be supported (as you can put regular constraints to a field and its getter). A challenge is how to obtain the values for constraint validation. In the spirit of BV 1 we&#39;d have to iterate the values directly from the field for evaluating the @NotBlank constraint and a second time through the getter for @Pattern validation. That&#39;s a potential performance issue of course.</div><div><br></div><div>What do others think?</div><div><br></div><div>Thanks,</div><div><br></div><div>--Gunnar</div><div><br></div></div>