List of utility methods to do Collection to String
String | toString(Collection collection, String separator, int fixedLength) Convert array into string in table format. Iterator iter; if (collection == null || (!(iter = collection.iterator()).hasNext())) { return ""; StringBuilder sb = new StringBuilder(matchLength(String.valueOf(iter.next()), "", fixedLength)); while (iter.hasNext()) { sb.append(separator).append(matchLength(String.valueOf(iter.next()), "", fixedLength)); return sb.toString(); |
String | toString(Collection objects) to String String string = ""; for (Object object : objects) { string = string + object.toString() + ", "; try { string = string.substring(0, string.length() - 2); } catch (StringIndexOutOfBoundsException sioobe) { return ""; ... |
String | toString(Collection setOfTests) to String String errorSet = "[\n"; for (Object test : setOfTests) { errorSet += test + ", \n"; errorSet += "]"; return errorSet; |
String | toString(Collection softwareTags) to String StringBuffer sb = new StringBuffer(); for (Iterator i = softwareTags.iterator(); i.hasNext();) { Object softwareTag = i.next(); String tagName = null; sb.append(SPACE); if (tagName.indexOf(SPACE) != -1) { sb.append(QUOTE).append(tagName).append(QUOTE); } else { ... |
String | toString(Collection extends Object> collection) Method description StringBuilder sb = new StringBuilder(); if (collection != null) { Iterator<? extends Object> it = collection.iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); return sb.toString(); |
String | toString(Collection extends Object> collection, String prefix, String suffix) to String StringBuilder sb = new StringBuilder(); for (Object line : collection) { sb.append(prefix); sb.append(line.toString()); sb.append(suffix); return sb.toString(); |
String | toString(Collection> c) Returns the given Collection as formatted String StringBuilder buffer = new StringBuilder(); Iterator it = c.iterator(); for (int i = 0; it.hasNext(); i++) { buffer.append(i).append(": ").append(it.next()).append('\n'); if (buffer.length() > 1) { buffer.setLength(buffer.length() - 1); return buffer.toString(); |
String | toString(Collection> c) to String if (c == null) { return STRING_NULL; if (c.isEmpty()) { return STRING_LIST_EMPTY; StringBuilder string = new StringBuilder(4 * c.size()); boolean sep = false; ... |
String | toString(Collection> collection) to String if (collection == null || collection.isEmpty()) { return ""; StringBuilder stringBuilder = new StringBuilder("["); for (Object object : collection) { if (object instanceof Collection<?>) { stringBuilder.append(toString((Collection<?>) object)); } else { ... |
String | toString(Collection> collection) to String if (isEmpty(collection)) { return ""; StringBuilder sb = new StringBuilder(); for (Object o : collection) { sb.append(o.toString()).append(", "); sb.setLength(sb.length() - 2); ... |