paulwong

JSR-303 Bean Validation - @Size和@Max@Min的区别

@Min and @Max are used for validating numeric fields which could be String(representing number), intshortbyte etc and their respective primitive wrappers.

@Size is used to check the length constraints on the fields.

As per documentation @Size supports StringCollectionMap and arrays while @Min and @Max supports primitives and their wrappers. See the documentation.

posted on 2021-04-29 09:55 paulwong 阅读(423) 评论(0)  编辑  收藏 所属分类: J2SEBean Validation


只有注册用户登录后才能发表评论。


网站导航: