首页 > 其他 > 详细

弱校验之@NotNull@NotEmpty@NotBlank

时间:2020-07-13 15:55:26      阅读:80      评论:0      收藏:0      [点我收藏+]
  • @NotNull
适用于非空判断
The annotated element must not be {@code null}.
CharSequence, Collection, Map 和 Array 对象不能是 null, 但可以是空集(size = 0)。  
  • @NotEmpty
适用于判断集合非空且有值
The annotated element must not be {@code null} nor empty. Supported 
CharSequence, Collection, Map 和 Array 对象不能是 null 并且相关对象的 size 大于 0。  
  • @NotBlank
适用于判断字符串非空且非空字符串
The annotated element must not be {@code null} and must contain at least one
non-whitespace character. Accepts {@code CharSequence}.
String 不是 null 且去除两端空白字符后的长度(trimmed length)大于 0。 

弱校验之@NotNull@NotEmpty@NotBlank

原文:https://www.cnblogs.com/zhucww/p/13293148.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!