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:gaffer.function.simple.transform.Concat.java
@Override public Object[] transform(final Object[] input) { return new Object[] { StringUtils.join(input, separator) }; }
From source file:com.goncalomb.bukkit.nbteditor.TestBosEntities.java
@Test public void testBosEntities() { HashSet<EntityType> entityTypes = new HashSet<EntityType>(); entityTypes.addAll(Arrays.asList(EntityType.values())); entityTypes.removeAll(EntityNBT.getValidEntityTypes()); if (!entityTypes.isEmpty()) { System.out.print("Missing BoS entities: "); System.out.print(StringUtils.join(entityTypes, ", ")); System.out.println("."); }// w ww .j a v a2 s .c o m }
From source file:eu.europa.ec.fisheries.uvms.rules.mapper.AbstractRulesBaseMapper.java
String joinListOfStringsInCommaSeparatedString(List<String> xpaths) { if (CollectionUtils.isEmpty(xpaths)) { return StringUtils.EMPTY; }//from www . j av a 2s .c o m return StringUtils.join(xpaths, ","); }
From source file:com.netflix.paas.cassandra.keys.ClusterKey.java
public String getCanonicalName() { return StringUtils.join(new String[] { this.discoveryType, this.clusterName }, "."); }
From source file:de.tudarmstadt.ukp.dkpro.core.toolbox.core.Text.java
@Override public String toString() { return StringUtils.join(getSentences(), ' '); }
From source file:eionet.web.util.JstlFunctions.java
/** * * @param o/* ww w.j a v a 2 s . c o m*/ * @param seperator * @return */ public static String join(Object o, String separator) { if (o == null) { return ""; } else if (o instanceof String) { return (String) o; } else if (o instanceof Object[]) { return StringUtils.join((Object[]) o, separator); } else if (o instanceof Collection) { return StringUtils.join((Collection) o, separator); } else { throw new ClassCastException("Couldn't cast from this class: " + o.getClass().getName()); } }
From source file:com.vmware.bdd.plugin.ambari.api.model.cluster.ApiRestartRequiredCompent.java
public String getStringHosts() { return StringUtils.join(this.hosts, ","); }
From source file:com.collective.celos.ci.testing.fixtures.compare.CompareHelper.java
private static <T> String getDifference(Set<Map.Entry<T, Integer>> entrySet) { List<String> strs = Lists.newArrayList(); for (Map.Entry<T, Integer> entry : entrySet) { strs.add(entry.getKey().toString() + " [" + entry.getValue() + " times]"); }/*from www.j av a 2 s.co m*/ Collections.sort(strs); return StringUtils.join(strs, "\n"); }
From source file:edu.illinois.cs.cogcomp.annotation.BasicTextAnnotationBuilder.java
/** * The default way to create a {@link TextAnnotation} from pre-tokenized text. * //w ww .ja v a 2 s . c om * @param tokenizedSentences A list of sentences, each one being a list of tokens * @return A {@link TextAnnotation} containing the SENTENCE and TOKENS views. */ public static TextAnnotation createTextAnnotationFromTokens(String corpusId, String textId, List<String[]> tokenizedSentences) { Tokenization tokenization = tokenizeTextSpan(tokenizedSentences); String text = ""; for (String[] sentenceTokens : tokenizedSentences) text += StringUtils.join(sentenceTokens, ' ') + System.lineSeparator(); return new TextAnnotation(corpusId, textId, text, tokenization.getCharacterOffsets(), tokenization.getTokens(), tokenization.getSentenceEndTokenIndexes()); }
From source file:com.yolodata.tbana.hadoop.mapred.shuttl.TestMapper.java
@Override public void map(LongWritable key, List<Text> values, OutputCollector<LongWritable, Text> outputCollector, Reporter reporter) throws IOException { Text output = new Text(StringUtils.join(values, ",")); outputCollector.collect(key, output); }