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 ""; }