add empty validae

This commit is contained in:
Looly 2021-05-24 15:25:27 +08:00
parent ee86ac5ca0
commit 0fa8043c11
3 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.6.6 (2021-05-22)
# 5.6.6 (2021-05-24)
### 🐣新特性
* 【cron 】 增加时间轮简单实现
@ -13,6 +13,7 @@
* 【core 】 FileUtil.isEmpty不存在时返回trueissue#1582@Github
* 【core 】 PhoneUtil增加中国澳门和中国台湾手机号校检方法pr#331@Gitee
* 【db 】 分页查询自定义sql查询添加参数pr#332@Gitee
* 【core 】 IdCardUtil.isValidCard增加非空判断
### 🐞Bug修复
* 【core 】 修复XmlUtil中omitXmlDeclaration参数无效问题issue#1581@Github

View File

@ -494,10 +494,11 @@ public class ListUtil {
}
/**
* 获取一个空List
* 获取一个空List这个空List不可变
*
* @param <T> 元素类型
* @return 空的List
* @see Collections#emptyList()
* @since 5.2.6
*/
public static <T> List<T> empty() {

View File

@ -153,6 +153,10 @@ public class IdcardUtil {
* @return 是否有效
*/
public static boolean isValidCard(String idCard) {
if(StrUtil.isBlank(idCard)){
return false;
}
idCard = idCard.trim();
int length = idCard.length();
switch (length) {