From c33cf2c38b5a4afe76d7d49fe71852ee73588dd1 Mon Sep 17 00:00:00 2001 From: wangyu <727842003@qq.com> Date: Thu, 30 Sep 2021 21:44:44 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E7=9A=84=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/flyfish/framework/utils/StringHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flyfish-common/src/main/java/com/flyfish/framework/utils/StringHelper.java b/flyfish-common/src/main/java/com/flyfish/framework/utils/StringHelper.java index ef937c1..26280da 100644 --- a/flyfish-common/src/main/java/com/flyfish/framework/utils/StringHelper.java +++ b/flyfish-common/src/main/java/com/flyfish/framework/utils/StringHelper.java @@ -1,6 +1,7 @@ package com.flyfish.framework.utils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import java.util.Collection; import java.util.function.Function; @@ -15,6 +16,7 @@ public class StringHelper { /** * 获取对象的值 + * * @param obj 对象 * @return 结果 */ @@ -24,14 +26,15 @@ public class StringHelper { /** * 快速的join一个集合 + * * @param collection 集合 - * @param mapper 映射 - * @param 泛型 + * @param mapper 映射 + * @param 泛型 * @return 结果 */ public static String join(Collection collection, Function mapper) { if (CollectionUtils.isNotEmpty(collection)) { - return collection.stream().map(mapper).collect(Collectors.joining(",")); + return collection.stream().map(mapper).filter(StringUtils::isNoneBlank).collect(Collectors.joining(",")); } return ""; }