From 0da48a8bf871e2da97e64cf995404f945b7ed34d Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 23 九月 2019 23:47:26 +0800
Subject: [PATCH] 前台上传文件后端服务能够正常解析得到相应数据,数据保存未处理
---
java110-common/src/main/java/com/java110/common/util/Assert.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/java110-common/src/main/java/com/java110/common/util/Assert.java b/java110-common/src/main/java/com/java110/common/util/Assert.java
index 368e93a..7e61781 100644
--- a/java110-common/src/main/java/com/java110/common/util/Assert.java
+++ b/java110-common/src/main/java/com/java110/common/util/Assert.java
@@ -6,6 +6,7 @@
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -265,4 +266,45 @@
}
+ @SuppressWarnings("rawtypes")
+ public static boolean objIsEmpty(Object o) {
+ if (o == null) {
+ return true;
+ }
+ if (o instanceof String) {
+ if (o.toString().trim().equals("")) {
+ return true;
+ }
+ if (o.equals("null") || o.equals("NULL")) {
+ return true;
+ }
+ } else if (o instanceof List) {
+ if (((List) o).size() == 0) {
+ return true;
+ }
+ } else if (o instanceof Map) {
+ if (((Map) o).size() == 0) {
+ return true;
+ }
+ } else if (o instanceof Set) {
+ if (((Set) o).size() == 0) {
+ return true;
+ }
+ } else if (o instanceof Object[]) {
+ if (((Object[]) o).length == 0) {
+ return true;
+ }
+ } else if (o instanceof int[]) {
+ if (((int[]) o).length == 0) {
+ return true;
+ }
+ } else if (o instanceof long[]) {
+ if (((long[]) o).length == 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
}
--
Gitblit v1.8.0