Java Utililty Methods Collection Dump

List of utility methods to do Collection Dump

Description

The list of methods to do Collection Dump are organized into topic(s).

Method

voiddumpCollection(Collection collection)
dump Collection
for (T o : collection) {
    System.out.println(o);
voiddumpCollection(Object[] c, StringBuilder sb, int indent)
dump Collection
if (indent > 0) {
    for (int in = 0; in < indent - 1; in++) {
        sb.append('\t');
    sb.append("[\n");
for (Object o : c) {
    if (o instanceof Map) {
...
voiddumpCollection(String msg, Collection c)
dump Collection
System.out.println("DUMPING collection: " + msg); 
if (c == null) {
    System.out.println("null"); 
    return;
for (Iterator iter = c.iterator(); iter.hasNext();) {
    System.out.println(iter.next().toString());
voiddumpCollectionCollection(Collection c)
dump Collection Collection
for (Iterator<?> iter = c.iterator(); iter.hasNext();) {
    dumpCollection("", (List<?>) iter.next()); 
StringdumpList(Collection list)
dump List
StringBuilder buf = new StringBuilder();
if (list == null) {
    buf.append("null");
} else {
    buf.append('[');
    int count = 0;
    for (T elem : list) {
        if (count > 0)
...
voiddumpList(StringBuffer sb, Collection slist)
dump List
boolean first = true;
for (T s : slist) {
    if (!first) {
        sb.append(",");
    sb.append(s);
    first = false;
StringdumpToString(Collection c, String separator)
dump To String
String retval = "";
for (Iterator it = c.iterator(); it.hasNext();) {
    retval += String.valueOf(it.next());
    retval += separator;
return retval;