List of utility methods to do Collection to String
String | collectionToString(final Collection collection, final String recordSeparator) collection To String final StringBuilder sb = new StringBuilder(); if (collection != null) { for (final Iterator iterator = collection.iterator(); iterator.hasNext();) { final Object obj = iterator.next(); if (obj != null) { sb.append(obj.toString()); if (iterator.hasNext()) { sb.append(recordSeparator); ... |
String | collectionToString(final Collection> aCol, final String aSepLines) collection To String StringBuilder wRes = new StringBuilder(2048); Iterator<?> wIt = aCol.iterator(); while (wIt.hasNext()) { if (wRes.length() != 0) { wRes.append(aSepLines); Object wObj = wIt.next(); if (wObj == null) { ... |
String | collectionToString(final Collection> c) Converts a Collection into a String final Iterator<?> iter = c == null ? null : c.iterator(); if (!hasNext(iter)) { return null; final StringBuilder sb = new StringBuilder(); for (; iter.hasNext();) { final String s = toString(iter.next()); if (s != null) { ... |
String | collectionToString(final Collection> collection, final String separator) Creates a string representation of the elements in the collection separated by separator .
StringBuilder sb = new StringBuilder(); for (Iterator<?> iter = collection.iterator(); iter.hasNext();) { sb.append(iter.next()); if (iter.hasNext()) { sb.append(separator); return sb.toString(); ... |
String | collectionToString(final Collection> elements, final String separator) collection To String String result = ""; final Iterator<?> iterator = elements.iterator(); while (iterator.hasNext()) { final Object object = iterator.next(); result += object.toString(); if (iterator.hasNext()) result += separator; return result; |
String | collectionToString(final String separator, final Collection> coll) collection To String final StringBuffer buf = new StringBuffer(); final Iterator<?> it = coll.iterator(); while (it.hasNext()) { final Object item = it.next(); if (item == null) { buf.append("null"); } else { buf.append(item.toString()); ... |
String | collectionToString(Iterable Create a string representation of an iterable collection StringBuilder b = new StringBuilder(); b.append("["); Iterator<T> it = c.iterator(); while (it.hasNext()) { b.append(it.next()); if (it.hasNext()) b.append(","); b.append("]"); return b.toString(); |
String | collectionToString(Object[] objects) collection To String String s = ""; for (int i = 0; i < objects.length; i++) { s += objects[i].toString(); if (i < objects.length - 1) { s += ", "; return s; ... |
String | collectionToString(String prefix, Collection> list) collection To String if (list == null) return "null"; StringBuilder sb = new StringBuilder(); sb.append(prefix); sb.append('['); boolean first = true; for (Object item : list) { if (!first) { ... |
String[] | collectionToStringArray(Collection holder) { method String[] ret = new String[holder.size()]; holder.toArray(ret); return (ret); |