简介
导入依赖
org.springframework.boot
spring-boot-starter-validation...Boolean, boolean 检查带注释的元素是否为true
@DecimalMax BigDecimal, BigInteger, CharSequence, byte, short, int,...可选参数regexp和flags允许指定电子邮件必须匹配的其他正则表达式
@Min BigInteger, CharSequence, byte, short, int, long 检查带注释的值是否大于或等于指定的最小值...与@NotEmpty的区别在于,此约束只能应用于字符序列
@NotEmpty CharSequence,Collection,Map和数组 检查带注释的元素是否不为null或为空
@NotNull 任何类型...检查注释的值是否不是 null
@Negative BigDecimal,BigInteger,byte,short,int,long 检查元素是否为负数。