标签: java validation
如何使用javax.validation验证里面元素的长度?
javax.validation
@Size(min = 2, max = 3) private String value; private List<String> list;
答案 0 :(得分:-1)
hibernate-validator 5.2.x将支持以下语法,这很棒:
List<@Length(min = 2, max = 3) String> list;