diff --git a/diboot-core/src/main/java/com/diboot/core/mapper/BaseCrudMapper.java b/diboot-core/src/main/java/com/diboot/core/mapper/BaseCrudMapper.java index 6f66a21..635856b 100644 --- a/diboot-core/src/main/java/com/diboot/core/mapper/BaseCrudMapper.java +++ b/diboot-core/src/main/java/com/diboot/core/mapper/BaseCrudMapper.java @@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 基础CRUD的父类Mapper * @author Mazhicheng - * @version 2018/12/22 - * Copyright © www.dibo.ltd + * @version v2.0 + * @date 2018/12/22 */ public interface BaseCrudMapper extends BaseMapper { diff --git a/diboot-core/src/main/java/com/diboot/core/mapper/MetadataMapper.java b/diboot-core/src/main/java/com/diboot/core/mapper/MetadataMapper.java index 41bca4d..17c0c25 100644 --- a/diboot-core/src/main/java/com/diboot/core/mapper/MetadataMapper.java +++ b/diboot-core/src/main/java/com/diboot/core/mapper/MetadataMapper.java @@ -5,8 +5,8 @@ import com.diboot.core.entity.Metadata; /** * 元数据Mapper * @author Mazhicheng - * @version 2018/12/22 - * Copyright © www.dibo.ltd + * @version v2.0 + * @date 2018/12/22 */ public interface MetadataMapper extends BaseCrudMapper { diff --git a/diboot-core/src/main/java/com/diboot/core/util/V.java b/diboot-core/src/main/java/com/diboot/core/util/V.java index 91b0a22..91493f4 100644 --- a/diboot-core/src/main/java/com/diboot/core/util/V.java +++ b/diboot-core/src/main/java/com/diboot/core/util/V.java @@ -22,7 +22,21 @@ public class V { * @return */ public static boolean isEmpty(Object obj){ - return obj == null; + if(obj instanceof String){ + return isEmpty((String)obj); + } + else if(obj instanceof Collection){ + return isEmpty((Collection)obj); + } + else if(obj instanceof Map){ + return isEmpty((Map)obj); + } + else if(obj instanceof String[]){ + return isEmpty((String[])obj); + } + else{ + return obj == null; + } } /*** @@ -67,7 +81,21 @@ public class V { * @return */ public static boolean notEmpty(Object obj){ - return obj != null; + if(obj instanceof String){ + return notEmpty((String)obj); + } + else if(obj instanceof Collection){ + return notEmpty((Collection)obj); + } + else if(obj instanceof Map){ + return notEmpty((Map)obj); + } + else if(obj instanceof String[]){ + return notEmpty((String[])obj); + } + else{ + return obj != null; + } } /***