开发者

Bean Validation for @Past or today?

Here's a simple source, stating that this date must be in the past using Bean开发者_StackOverflow中文版 Validation :

@Past
private Date transactionDate;

Is there any BV annotation for validating that the date must be today or previous day?

Or perhaps I need to extend the constraint and provide my own?


Just found out the answer for this, @Past means today or any day before today.

So, using @Past suits my need without having to provide my own constraint.


To get past and today you can use

@PastOrPresent
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜