List of utility methods to do List to String
String | asString(List list) as String if (list == null || list.isEmpty()) return ""; StringBuilder builder = new StringBuilder(); for (Iterator i$ = list.iterator(); i$.hasNext(); builder.append(",")) { long a = ((Long) i$.next()).longValue(); builder.append(a); if (builder.charAt(builder.length() - 1) == ',') ... |
String | asString(List as String String s = ""; for (String cmd : commandLine) s += (s.equals("") ? "" : " ") + cmd; return s; |
List | asStringList(Collection extends Object> objects) Returns a list of strings, where the strings are the result of calling String.valueOf( Object ) of each object in the given collection. List<String> list = new ArrayList<>(); for (Object object : objects) { list.add(String.valueOf(object)); return list; |
ArrayList | asStringList(Collection> list) Calls toString for each element and adds it to a new list. ArrayList<String> result = new ArrayList<String>(list.size()); for (Object o : list) { result.add(o.toString()); return result; |
List | asStringList(Collection> objects) Returns a list containing the string representations of the given collection of objects. List<String> result = new ArrayList<String>(); for (Object o : objects) { result.add(String.valueOf(o)); return result; |
List | asStringList(List> coll) Returns a string list representation of the given list. List<String> result = new ArrayList<>(); for (Object t : coll) { result.add(t.toString()); return result; |
StringBuilder | asStringList(Set> attributes) as String List final StringBuilder b = new StringBuilder(); Iterator<?> iterator = attributes.iterator(); while (iterator.hasNext()) { final Object o = iterator.next(); b.append(o.toString()); if (iterator.hasNext()) { b.append(", "); return b; |
String[] | convertListToStrArray(List list) Converts a List to an String array.
if (list != null) { int cnt = list.size(); String[] strArray = new String[cnt]; for (int i = 0; i < cnt; i++) { String str = (String) list.get(i); strArray[i] = new String(str); return strArray; ... |
String | convertListToString(Iterable convert List To String return convertListToString(l, ", "); |
String | convertListToString(List list) convert List To String StringBuffer result = new StringBuffer(); String separator = ""; Iterator iter = list.iterator(); while (iter.hasNext()) { String line = iter.next().toString(); result.append(separator); result.append(line); separator = "\n"; ... |