List of utility methods to do Collection to String
String | asString(Collection c, String separator) as String if (c == null) { return ""; StringBuilder result = new StringBuilder(256); boolean needSeparator = false; for (Object o : c) { if (o == null) { continue; ... |
String | asString(Collection extends String> collection) as String if (isEmpty(collection)) { return ""; final StringBuilder asList = new StringBuilder(64); for (String item : collection) { asList.append(", ").append(item); return asList.substring(2); ... |
String[] | asStringArr(Collection> collection) as String Arr String res[] = new String[collection.size()]; int i = 0; for (Object s : collection) { res[i++] = String.valueOf(s); return res; |
String[] | asStringArray(Collection extends Object> coll) Convert the collection to a string array. int i = 0; String[] strings = new String[coll.size()]; for (Object o : coll) { strings[i++] = o.toString(); return strings; |
String[] | asStringArray(Collection as String Array String[] result = new String[collection.size()]; collection.toArray(result); return result; |
String | buildString(Collection build String List<String> retList = new ArrayList<String>(); String ret = ""; for (int i = startingArg; i < args.size(); i++) { String s = (String) args.toArray()[i]; ret += s + seperator; if (ret.length() > maxLength) { retList.add(ret); ret = ""; ... |
String | buildString(Collection build String String build = keys.toString(); if (keys.size() == 1) { build = build.replace("" + OPEN_TABLE_SEPARATOR, "").replace("" + CLOSE_TABLE_SEPARATOR, ""); return build; |
String | buildStringFromListForNuma(Collection build String From List For Numa if (!list.isEmpty()) { StringBuilder sb = new StringBuilder(); for (Integer item : list) { sb.append(item); sb.append(","); return sb.deleteCharAt(sb.length() - 1).toString(); return ""; |
String | collectionToCommaDelimitedString(Collection> items) collection To Comma Delimited String StringBuilder buf = new StringBuilder(); boolean first = true; for (Object item : items) { if (!first) { buf.append(","); buf.append(item); first = false; ... |
String | collectionToCommaDelimitedString(Collection Convert a List of Strings to a comma delimited String. if (list == null || list.isEmpty()) { return ""; StringBuilder sb = new StringBuilder(); final Iterator<String> it = list.iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { ... |