[bv-dev] BV 2.0 - Add constraints?

Emmanuel Bernard emmanuel at hibernate.org
Fri Mar 24 14:20:58 EDT 2017

> On 24 Mar 2017, at 06:43, Gunnar Morling <gunnar at hibernate.org> wrote:
> * I'm not convinced of @Positive / @Negative as they are are just
> syntactic sugar for @DecimalMin(value="0", inclusive=false) /
> @DecimalMax(value="0", inclusive=false). Hence I left them out. But we
> can add them in a second round if someone feels strongly about them.

I can see myself using @Positive a lot if it exists, I find it much more readable than @DecimalMin(value="0", inclusive=false) and can be even more generic and support float and double. I don’t imagine that rounding errors occur for 0.

Though there is probably a need for a @Positive(strict=true) and I would advocate strict to be false by default so that 0 is considered positive.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20170324/c9a2ef17/attachment.html 

More information about the beanvalidation-dev mailing list