List of utility methods to do List Join
String | concat(List Joins the tokens from position start to position end, the size is end-start. StringBuilder sb = new StringBuilder(); for (int i = start; i < end; i++) { if (i > start) { sb.append(joiner); sb.append(tokens.get(i)); return sb.toString(); ... |
String | concatAndJoin(String sep, List Concat a prefix and suffix to each element in a list, and join with a separator. StringBuilder builder = new StringBuilder(); boolean first = true; for (String str : data) { if (first) { first = false; } else { builder.append(sep); builder.append(prefix); builder.append(str); builder.append(suffix); return builder.toString(); |
boolean | contains(List Checks if joinParams contain value joinIndex boolean exists = false; for (int i = 0; i < joinParams.size(); i++) if (joinParams.get(i) == joinIndex) { exists = true; break; return exists; |
List | getJoinKeyValues(List get Join Key Values final ArrayList<String> values = new ArrayList<String>(); for (final int ind : joinKeyIndices) { final String val = tuple.get(ind); values.add(val); return values; |
String | join(char separator, List extends CharSequence> seqs) join return join(Character.toString(separator), false, seqs);
|
CharSequence | join(CharSequence delimiter, Iterable extends CharSequence> list) join Iterator<? extends CharSequence> it = list.iterator(); if (it.hasNext()) { StringBuilder sb = new StringBuilder(it.next()); while (it.hasNext()) { sb.append(delimiter); sb.append(it.next()); return sb.toString(); ... |
String | join(CharSequence delimiter, List extends CharSequence> elements) join StringBuilder result = new StringBuilder(); for (int i = 0; i < elements.size(); i++) { result.append(elements.get(i)); if (i != elements.size() - 1) { result.append(delimiter); return result.toString(); ... |
String | join(Collection> list, String separator) join if (list == null) { return null; Iterator<?> iterator = list.iterator(); Object first = iterator.next(); if (!iterator.hasNext()) { return valueOf(first); StringBuffer buf = new StringBuffer(256); if (first != null) { buf.append(first); while (iterator.hasNext()) { if (separator != null) { buf.append(separator); Object obj = iterator.next(); if (obj != null) { buf.append(obj); return buf.toString(); |
String | join(Collection> stringList, String seperator) join return join(stringList, seperator, "%s"); |
String | join(Collection Use this when you don't want to include Apache Common's string for plugins. StringBuffer buffer = new StringBuffer(); for (String str : list) { buffer.append(str); buffer.append(delimiter); return buffer.toString(); |