List of utility methods to do Collection to String
String | collectionToCommaSeparatedString(Collection Collection to comma separated string string. List<String> list = new ArrayList<>(); elementCollection.stream().forEach(element -> list.add(element)); return listToSeparatedString(list, ','); |
String | collectionToCommaSeparatedString(List collection To Comma Separated String return collectionToString(list, ", "); |
String | collectionToCommaString(Collection bundleSelection) collection To Comma String StringBuffer sb = new StringBuffer(); for (Iterator it = bundleSelection.iterator(); it.hasNext();) { if (sb.length() > 0) sb.append(','); sb.append(it.next().toString()); return sb.toString(); |
String | collectionToCSString(Collection Transform collection to comma split string. if (col == null) { return null; StringBuilder sb = new StringBuilder(); for (E e : col) { sb.append(e).append(","); if (sb.length() > 0) { ... |
String | collectionToDelimitedString(Iterable collection To Delimited String return collectionToDelimitedString(iterable, ","); |
String | collectionToDelimitedString(Collection c, String delim) Convenience method to return a Collection as a delimited (e.g. if (c == null) return "null"; StringBuffer sb = new StringBuffer(); Iterator itr = c.iterator(); int i = 0; while (itr.hasNext()) { if (i++ > 0) sb.append(delim); ... |
String | collectionToDelimitedString(Collection coll, String delim) collection To Delimited String return collectionToDelimitedString(coll, delim, "", ""); |
String | collectionToDelimitedString(Collection coll, String delim, String prefix, String suffix) Convenience method to return a Collection as a delimited (e.g. if (coll == null || coll.isEmpty()) { return ""; StringBuffer sb = new StringBuffer(); Iterator it = coll.iterator(); while (it.hasNext()) { sb.append(prefix).append(it.next()).append(suffix); if (it.hasNext()) { ... |
String | collectionToDelimitedString(Collection coll, String delim, String prefix, String suffix) collection To Delimited String if (coll == null) { return ""; StringBuffer sb = new StringBuffer(); Iterator it = coll.iterator(); int i = 0; while (it.hasNext()) { if (i > 0) { ... |
String | collectionToDelimitedString(Collection> col, String del) collection To Delimited String if (col == null || col.isEmpty()) { return ""; StringBuilder sb = new StringBuilder(); Iterator<?> it = col.iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { ... |