[bv-dev] @Past(orPresent=true) -> @PastOrPresent?

Emmanuel Bernard emmanuel at hibernate.org
Wed Jun 21 13:00:15 EDT 2017


My argument against is that @Past / @Future could need additional options: like maybe past per year or month instead of instant time. I understand we do use the type structure to extract that information.
Is there potential options people can think of around time constraints?

For @Positive/@Negative, we decided there were none.

> On 21 Jun 2017, at 11:50, Gunnar Morling <gunnar at hibernate.org> wrote:
> 
> Hi all,
> 
> A colleague of mine reviewing the BV 2.0 changes pointed out an
> inconsistency in the added/modified constraints.
> 
> As per the community poll we have now @NegativeOrZero and
> @PositiveOrZero, whereas we still have the orPresent() option on @Past
> and @Future. Should it be @PastOrPresent and @FutureOrPresent instead
> for the sake of consistency?
> 
> Now one could argue that having only attributes (orPresent(),
> orZero()) is most consistent with other constraints such as
> @DigitalMin. But indeed the explicit annotations grew on me over time
> as they are a bit shorter to use and, more importantly, better to
> read.
> 
> It's late in the game, but I feel inclined to extract @PastOrPresent
> and @FutureOrPresent. What do you think?
> 
> Thanks,
> 
> --Gunnar
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev




More information about the beanvalidation-dev mailing list