@NotNull和@NotEmpty和@NotBlank区别

1.@NotNull:不能为null,但可以为empty。用在实体类

2.@NotEmpty:不能为null,而且长度必须大于0, 一般用在集合中

3.@NotBlank:只能作用在String上,不能为null,而且调用trim()后,长度必须大于0 用在字符串中

原文地址:https://www.cnblogs.com/520playboy/p/7543335.html