From 6344ce090bd5c23d9d623cb5a1a5660611f00df3 Mon Sep 17 00:00:00 2001 From: csx <1981897232@qq.com> Date: Sun, 28 Dec 2025 17:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=99=88?= =?UTF-8?q?=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/11/28=2015?= =?UTF-8?q?=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E6=8E=A8=E9=80=81=E5=85=AC?= =?UTF-8?q?=E4=BA=AB=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1v1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/shkd/sys/sys/utils/EmptyUtil.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/utils/EmptyUtil.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/utils/EmptyUtil.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/utils/EmptyUtil.java new file mode 100644 index 0000000..c597c2a --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/utils/EmptyUtil.java @@ -0,0 +1,119 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package shkd.sys.sys.utils; + +import java.math.BigDecimal; +import java.util.Collection; +import java.util.Map; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; +import kd.tmc.fbp.common.constant.Constants; + +public class EmptyUtil extends StringUtils { + public EmptyUtil() { + } + + public static boolean isEmpty(String s) { + return s == null || s.trim().length() == 0; + } + + public static boolean isNoEmpty(String string) { + return !isEmpty(string); + } + + public static boolean isEmpty(Long l) { + return l == null || l == 0L; + } + + public static boolean isNoEmpty(Long l) { + return !isEmpty(l); + } + + public static boolean isEmpty(BigDecimal l) { + return l == null || l.compareTo(Constants.ZERO) == 0; + } + + public static boolean isNoEmpty(BigDecimal o) { + return !isEmpty(o); + } + + public static boolean isEmpty(Integer l) { + return l == null || l == 0; + } + + public static boolean isNoEmpty(Integer l) { + return !isEmpty(l); + } + + public static boolean isEmpty(Object[] param) { + return param == null || param.length == 0 || isEmpty(param[0]); + } + + public static boolean isNoEmpty(Object[] param) { + return !isEmpty(param); + } + + public static boolean isEmpty(Collection coll) { + return coll == null || coll.isEmpty(); + } + + public static boolean isEmpty(DynamicObjectCollection coll) { + return coll == null || coll.isEmpty(); + } + + public static boolean isNoEmpty(DynamicObjectCollection coll) { + return !isEmpty(coll); + } + + public static boolean isEmpty(DynamicObject info) { + return info == null; + } + + public static boolean isNoEmpty(DynamicObject info) { + return !isEmpty(info); + } + + public static boolean isEmpty(Object obj) { + if (obj instanceof String) { + return isEmpty((String)obj); + } else if (obj instanceof Long) { + return isEmpty((Long)obj); + } else if (obj instanceof Integer) { + return isEmpty((Integer)obj); + } else if (obj instanceof BigDecimal) { + return isEmpty((BigDecimal)obj); + } else if (obj instanceof DynamicObjectCollection) { + return isEmpty((DynamicObjectCollection)obj); + } else if (obj instanceof Collection) { + return isEmpty((Collection)obj); + } else if (obj instanceof Object[]) { + return isEmpty((Object[])((Object[])obj)); + } else if (obj instanceof Map) { + return ((Map)obj).isEmpty(); + } else { + return obj == null; + } + } + + public static boolean isNoEmpty(Object o) { + return !isEmpty(o); + } + + public static boolean isAnyoneEmpty(Object... objects) { + Object[] var1 = objects; + int var2 = objects.length; + + for(int var3 = 0; var3 < var2; ++var3) { + Object object = var1[var3]; + if (isEmpty(object)) { + return true; + } + } + + return false; + } +}