package com.panzhihua.common.utlis; import com.panzhihua.common.model.vos.community.ComMngPopulationCommunityTagsVo; import java.util.List; /** * @author lyq * 社区标签工具类 */ public class LabelUtils { /** * 社区标签转换 * @param communityTagsList 社区标签列表 * @return 社区标签 */ public static String assembleLabel(List communityTagsList){ //创建用户拼接字符串 StringBuilder sb = new StringBuilder(); communityTagsList.forEach(tag -> { if(StringUtils.isNotEmpty(tag.getLabel())){ sb.append(tag.getCommunityName()); sb.append(":"); sb.append(tag.getLabel()); sb.append(";"); } }); String result = sb.toString(); if(StringUtils.isNotEmpty(result)){ result = result.substring(0,result.length() - 1); } return result; } }