List of utility methods to do Collection Join
CharSequence | join(String delim, Collection> values) join if (values.isEmpty()) { return ""; Iterator<?> iterator = values.iterator(); if (values.size() == 1) { return iterator.next().toString(); StringBuilder builder = new StringBuilder(); ... |
String | join(String delim, Collection Join. String[] values = new String[collections.size()]; collections.toArray(values); return join(delim, 0, collections.size(), values); |
String | join(String delim, Collection join if (values == null || values.size() == 0) { return ""; StringBuilder s = new StringBuilder(); for (String v : values) { s.append(delim); s.append(v); return s.toString().substring(delim.length()); |
String | join(String delimeter, Collection join boolean isFirst = true; String rval = ""; for (T i : items) { if (!isFirst) rval += delimeter; else isFirst = false; rval += i.toString(); ... |
String | join(String delimiter, Collection extends Object> objects) join if (objects == null || objects.isEmpty()) { return EMPTY_STRING; Iterator<? extends Object> iterator = objects.iterator(); StringBuilder builder = new StringBuilder(); builder.append(iterator.next()); while (iterator.hasNext()) { builder.append(delimiter).append(iterator.next()); ... |
String | join(String delimiter, Collection extends Object> objects) join if (objects == null || objects.isEmpty()) { return EMPTY_STRING; Iterator<? extends Object> iterator = objects.iterator(); StringBuilder builder = new StringBuilder(); builder.append(iterator.next()); while (iterator.hasNext()) { builder.append(delimiter).append(iterator.next()); ... |
String | join(String delimiter, Collection> a) join if (a.isEmpty()) { return ""; StringBuilder buffer = new StringBuilder(); for (Object o : a) { buffer.append(delimiter); buffer.append(o); return buffer.substring(delimiter.length()); |
String | join(String delimiter, Collection> items) Joins string items into one string separated by delimiter. if (isEmpty(items)) return ""; StringBuilder result = new StringBuilder(); boolean delimOk = !isEmpty(delimiter); for (Object item : items) { if (delimOk && result.length() > 0) result.append(delimiter); result.append(item); ... |
String | join(String delimiter, Collection> objects) join StringBuilder sb = new StringBuilder(); Iterator<?> iterator = filterNulls(objects).iterator(); while (iterator.hasNext()) { Object next = iterator.next(); sb.append(String.valueOf(next)); if (iterator.hasNext()) { sb.append(delimiter); return sb.toString(); |
String | join(String delimiter, Collection> parts) join return join(delimiter, parts == null ? EMPTY_ARRAY : parts.toArray());
|