I am looking for a nice way to pretty-print a Map.
Map
map.toString() gives me: {key1=value1, key2=value2, key3=value3}
map.toString()
{key1=value1, key2=value2, key3=value3}
I
Simple and easy. Welcome to the JSON world. Using Google's Gson:
new Gson().toJson(map)
Example of map with 3 keys:
{"array":[null,"Some string"],"just string":"Yo","number":999}