Allow for iterables to be CSV-ified

This commit is contained in:
md_5 2013-09-29 18:49:20 +10:00
parent b541e7aa76
commit 33e11f4c44

View File

@ -54,12 +54,12 @@ public class Util
+ ( ( trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" ); + ( ( trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" );
} }
public static String csv(Collection<?> objects) public static String csv(Iterable<?> objects)
{ {
return format( objects, ", " ); return format( objects, ", " );
} }
public static String format(Collection<?> objects, String separators) public static String format(Iterable<?> objects, String separators)
{ {
StringBuilder ret = new StringBuilder(); StringBuilder ret = new StringBuilder();
for ( Object o : objects ) for ( Object o : objects )