Java Map to String mapToString(Map map)

Here you can find the source of mapToString(Map map)

Description

map To String

License

Apache License

Declaration

public static String mapToString(Map map) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Iterator;

import java.util.Map;

public class Main {
    public static String mapToString(Map map) {
        if (map == null) {
            return null;
        }//from w  w w . j a  v a 2 s .c  o  m

        StringBuffer sBuffer = new StringBuffer();
        Iterator keys = map.keySet().iterator();
        while (keys.hasNext()) {
            Object key = keys.next();
            sBuffer.append("\n").append(key).append(" = ").append(map.get(key));
        }
        return sBuffer.toString();
    }
}

Related

  1. mapToString(final Map m)
  2. mapToString(final Map map)
  3. mapToString(Map map)
  4. mapToString(Map map)
  5. mapToString(Map map)
  6. mapToString(Map map)
  7. mapToString(Map map)
  8. mapToString(Map map)
  9. mapToString(Map map)