[bv-dev] Support for constraints on container values (e.g. Collection<@Email String>)

Christian Kaltepoth christian at kaltepoth.de
Fri Sep 30 08:35:43 EDT 2016


Hey Gunnar,


>>    1. I was wondering whether the distinction between
>>    SingleContainerValueExtractor and ManyContainerValuesExtractor is
>>    really necessary. I'm not sure if the unnecessary instantiation of an
>>    iterator in the single value case is really a problem in practice. I think
>>    extractor implementations will provide some special implementation of the
>>    Iterator/Iterable contract in any case. Not sure how others feel
>>    about that.
>>
>> Good question. I reckon we'll know more after experimenting with this in
> the RI.
>

I agree. The proposal mentions the possibility of having different
functional rules and better performance for the single value case as
reasons for the distinction. I just think that the latter one won't
actually be a real problem.


>>    1. Section 2.1 states that BV will support Iterable and Map by
>>    default. What about Optional? We will support the JDK8 date/time API,
>>    so why don't we plan to support Optional?
>>
>> Optional will be part of it by default. It should be stated somewhere, I
> hope :)
>

The document explicitly states:

*   Bean Validation will have out of the box support for containers
Iterable and Map.*

I was expecting Optional to be listed here too. That's why I mentioned it.
:-)


Christian



-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20160930/920d365e/attachment-0001.html 


More information about the beanvalidation-dev mailing list