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.mmj.app.lucene.search.utils.CustomSolrQueryConvert.java
public static SolrQuery to(UserSearchQuery query) { // ?//from ww w . ja v a 2s. 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("nick:*" + q + "*"); } else { params.add(filterQuery(q)); } } } // List<String> fiter = new ArrayList<String>(); return createSearchQuery(params, fiter, query); }
From source file:com.github.stagirs.lingvo.build.model.Lemma.java
public static String serialize(Lemma lemma) { List<String> items = new ArrayList<String>(); for (WordForm item : lemma.items) { items.add(WordForm.serialize(item)); }// www . j a v a 2 s . co m return StringUtils.join(items, "\t"); }
From source file:de.dfki.resc28.ole.bootstrap.Util.java
public static Literal toStringLiteral(List<TerminalNode> tokens, String separator) { return ResourceFactory.createTypedLiteral(StringUtils.join(tokens.toArray(), separator), XSDDatatype.XSDstring);//from w w w .j av a 2 s . c o m }
From source file:com.canoo.webtest.plugins.pdftest.PdfToFontsFilter.java
static String fontsToString(final List _fonts) { final List strings = new ArrayList(); for (int i = 0; i < _fonts.size(); i++) { final PDFFont font = (PDFFont) _fonts.get(i); strings.add(font.getPage() + "|" + font.getType() + "|" + font.getName()); }/*from w w w.ja v a2 s . c om*/ Collections.sort(strings); final String lineSep = System.getProperty("line.separator"); return StringUtils.join(strings, lineSep); }
From source file:com.github.stagirs.lingvo.build.model.Annotation.java
public static String serialize(Annotation annotation) { List<String> items = new ArrayList<String>(); for (WordForm item : annotation.items) { items.add(WordForm.serialize(item)); }/* w w w.ja va 2 s. co m*/ return annotation.text + "\t" + StringUtils.join(items, "\t"); }
From source file:com.google.api.ads.adwords.awreporting.authentication.OAuthScope.java
/** * Convenience method to provide a comma separated scope list * consisting of the services provided in the {@link SCOPE_TYPE}s. * @param scopeTypes//from ww w .java 2s . c o m * @return scopes in csv format */ public static String getScopeCsv(SCOPE_TYPE... scopeTypes) { List<String> scope = getScopeList(scopeTypes); return StringUtils.join(scope, ','); }
From source file:com.vmware.aurora.exception.BaseVMException.java
public static BaseVMException INVALID_STATUS(Object... expectedStatus) { return new BaseVMException(null, "INVALID_STATUS", StringUtils.join(expectedStatus, " or ")); }
From source file:cn.hxh.springside.utils.validator.ValidatorUtils.java
/** * , ?Set<ConstraintViolation>, separator. *//* ww w . ja v a 2s . com*/ public static String convertMessage(Set<? extends ConstraintViolation> constraintViolations, String separator) { List<String> errorMessages = Lists.newArrayList(); for (ConstraintViolation violation : constraintViolations) { errorMessages.add(violation.getMessage()); } return StringUtils.join(errorMessages, separator); }
From source file:AIR.Common.Sql.DbHelper.java
public static <T> String getDbCsvFromMathTypes(List<T> list) { // TODO Elena/Shiva return StringUtils.join(list, ','); }
From source file:com.microsoft.windowsazure.core.utils.CollectionStringBuilder.java
public static String join(List<String> values) { return StringUtils.join(values, separator); }