javax.validation.constraints中@NotEmpty,@NotNull,@NotBlank

@NotEmpty

The annotated element must not be {@code null} nor empty. Supported types are:
不能是null
不能是空字符
集合框架中的元素不能为空

@NotNul

被修饰元素不能为null

@NotBlank

The annotated element must not be {@code null} and must contain at least one
non-whitespace character.
这个注解用来判断字符串或者字符


版权声明:本文为tangyaya8原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。