mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 22:24:18 +01:00
Allow for iterables to be CSV-ified
This commit is contained in:
parent
b541e7aa76
commit
33e11f4c44
@ -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 )
|
||||||
|
Loading…
Reference in New Issue
Block a user