@NotEmpty、@NotBlank、@NotNull三种注解的区别
原文链接:https://blog.csdn.net/zyxwvuuvwxyz/article/details/80514144
@NotEmpty 用在集合类上面
加了@NotEmpty的String类、Collection、Map、数组,是不能为null或者长度为0的(String Collection Map的isEmpty()方法)
@NotBlank只用于String,不能为null且trim()之后size>0
@NotNull:不能为null,但可以为empty,没有Size的约束(主要用在基本数据类型上(Int,Integer,Double))
浙公网安备 33010602011771号