1.使用场景
2.引用的jar包
javax.validation.constraints
讨论的内容主要是这个包目录下的注解使用⚠️
参数校验注解解释
Name解释范围
NotBlank(mesage=)注解的字符串不能为 “” / 空只能为String类型NotNull(mesage=)注解的参数不能为null类型没有限制Pattern(regex= , mesage=)注解的参数进行正则匹配只能为String类型NotEmpty注解的参数不能是 null CharSequence, Collection, Map 和 Array 对象Null Size Email Max Min DecimalMax DecimalMin Digits AssertFalse AssertTrue Future FutureOrPresent Past PastOrPresent Negative NegativeOrZero Positive PositiveOrZero
转载请注明原文地址: https://win8.8miu.com/read-22206.html