List of usage examples for org.apache.commons.lang StringUtils join
public static String join(Collection<?> collection, String separator)
Joins the elements of the provided Collection
into a single String containing the provided elements.
From source file:com.github.hexocraft.random.items.command.RiCommandHelp.java
public RiCommandHelp(RandomItemsPlugin plugin) { super(plugin); this.setDescription(StringUtils.join(plugin.messages.cHelp, "\n")); this.setPermissionMessage(plugin.messages.AccesDenied); //this.setDisplayInlineDescription(true); this.removeArgument("page"); }
From source file:mrcg.domain.Index.java
public String getColumnList() { return StringUtils.join(columns, "_"); }
From source file:edu.cornell.mannlib.vitro.webapp.utils.logging.ToString.java
private static String setOfGraphsToString(Set<Graph> set) { Set<String> strings = new HashSet<>(); for (Graph g : set) { strings.add(graphToString(g));//from w ww . ja v a2s .c o m } return "[" + StringUtils.join(strings, ", ") + "]"; }
From source file:gool.generator.GeneratorHelper.java
public static String joinParams(List<?> parameters) { if (parameters == null) { return ""; }//from w w w. j a v a2s .c o m return StringUtils.join(parameters, ", "); }
From source file:com.github.stagirs.docextractor.wiki.WikiParser.java
private static Link getLink(Iterator<String> lems, String end) { List result = getElems(lems, end); String str = StringUtils.join(result, " "); if (!str.contains("|")) { return new Link(str, str); } else {/*from w w w . j a v a 2s.c o m*/ return new Link(str.substring(0, str.lastIndexOf("|")), str.substring(str.lastIndexOf("|") + 1)); } }
From source file:mvm.rya.indexing.accumulo.freetext.query.ASTNodeUtils.java
/** * Serialize a node (and it's children) to a parsable string. * //from ww w . j a va2 s .c o m * @param s * @return */ public static String serializeExpression(Node s) { if (s instanceof ASTTerm) { ASTTerm a = (ASTTerm) s; return (a.isNotFlag() ? "!" : "") + " " + a.getTerm(); } String prefix = ""; String suffix = ""; String join = " "; if (s instanceof ASTExpression) { ASTExpression a = (ASTExpression) s; prefix = (a.isNotFlag() ? "!" : "") + "("; suffix = ")"; join = " " + a.getType() + " "; } List<String> children = new ArrayList<String>(); for (int i = 0; i < s.jjtGetNumChildren(); i++) { children.add(serializeExpression(s.jjtGetChild(i))); } return prefix + StringUtils.join(children, join) + suffix; }
From source file:com.yolodata.tbana.hadoop.mapred.FileContentProvider.java
private static StringBuilder getStringBuilderWithHeader(String[] header) { StringBuilder result = new StringBuilder(); result.append(StringUtils.join(header, ",")); result.append("\n"); return result; }
From source file:com.mmj.app.lucene.search.utils.CustomSolrQueryConvert.java
public static SolrQuery to(TopicSearchQuery query) { // ?/*from w w w . j a v a 2 s. c o m*/ List<String> params = new ArrayList<String>(); // ? if (Argument.isNotEmpty(query.getWordList())) { String q = StringUtils.join(query.getWordList().toArray(new String[0]), " "); if (StringUtils.isNotBlank(q)) { if (q.length() == 1 || StringFormatter.matchsRegex(q, "^[a-zA-Z]+$") || StringFormatter.matchsRegex(q, "^\\d+$")) { params.add("topicSearch:*" + q + "*"); } else { params.add(filterQuery(q)); } } } // List<String> fiter = new ArrayList<String>(); TimeSearchEnum timeSearch = query.getTime(); if (timeSearch != null && timeSearch.getStartTimeLong() != null) { fiter.add(String.format("topicGmtCreate:[%s TO *]", timeSearch.getStartTimeLong())); } // ? SortSearchEnum sortSearch = query.getSort(); if (sortSearch != null && StringUtils.isNotEmpty(sortSearch.getSort())) { query.setSortFiled(sortSearch.getSort()); } return createSearchQuery(params, fiter, query, "/browse"); }
From source file:com.pureinfo.srm.product.action.EmailRemindProductAction.java
/** * @see com.pureinfo.ark.interaction.ActionBase#executeAction() *//*from w w w . j a va 2 s. co m*/ public ActionForward executeAction() throws PureException { String[] sIds = request.getParameterValues("id"); String sProductIds = StringUtils.join(sIds, ','); IProductMgr mgr = (IProductMgr) ArkContentHelper.getContentMgrOf(Product.class); String[] msgs = mgr.sendEmailForHandRemind(sProductIds); request.setAttribute("msg", msgs); request.setAttribute("forward", "Product3indexList.do?classId=" + SRMTypes.PRODUCT); return mapping.findForward("info"); }
From source file:gov.nih.nci.caintegrator.application.lists.ajax.CommonListFunctions.java
public static String getListAsList(ListType ty) { JSONObject res = new JSONObject(); res.put("listType", ty.toString()); String results = ""; HttpSession session = ExecutionContext.get().getSession(false); UserListBeanHelper helper = new UserListBeanHelper(session); List patientLists = helper.getLists(ty); if (!patientLists.isEmpty()) { for (int i = 0; i < patientLists.size(); i++) { UserList list = (UserList) patientLists.get(i); ListManager uploadManager = (ListManager) ListManager.getInstance(); Map paramMap = uploadManager.getParams(list); String commas = StringUtils.join(list.getList().toArray(), ","); String sty = list.getListOrigin() != null && !list.getListOrigin().equals(ListOrigin.Default) ? "color:#A90101" : "color:#000"; results += ("<li id='" + paramMap.get("listName") + "' title='" + commas + "' style='" + sty + "'>" + paramMap.get("listName") + "</li>"); }/* www . ja v a 2 s .c o m*/ } else { results = ""; } res.put("LIs", results); return res.toString(); }