[bv-dev] First Alpha release of Bean Validation 2.0 RI

Michael Nascimento misterm at gmail.com
Mon Feb 20 14:13:35 EST 2017


On Fri, Feb 17, 2017 at 5:11 AM, Gunnar Morling <gunnar at hibernate.org>
wrote:

> > You don't compare, because they are not the same. The idea is that the
> > Period must be defined in terms of the units for which you defined its
> > boundaries.
>
> I see. I'm wondering though how practical that will be. Will the
> developer who puts the constraint always know the structure of the
> Period set to the field (data set by the application user)?
>

In the case you want it to be validated, you ought to :-)


>
> > You shouldn't support threeten-extra, but rather arbitrary
> TemporalAmounts.
> > Then threeten-extra just happen to be one of those. There must be
> something
> > like @ChronoUnitMax/@ChronoUnitMin such as:
> >
> > @ChronoUnitMax(unit=DAYS, value=1)
>
> How would that look like for a Period with several elements set, e.g.
> "3 months, 2 days"? Would we need a dedicated member in @ChronoUnitMax
> for each value of ChronoUnit (which are a lot)?
>

What do you mean by a member in @ChronoUnitMax? In my example, I suggest
using unit as a member, leading to unit and value being the only members.


> We had a discussion of Duration et al. a while ago, but it petered
> out. So we thought we'd add something to the RI to spark a new
> discussion. Seems it worked :)


Can´t disagree :-)

Regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20170220/4bc4bb04/attachment.html 


More information about the beanvalidation-dev mailing list