puts(Maps.asPrettyJsonString(map));
puts(Boon.toPrettyJson(map));
Boon.toPrettyJson works with Set, Map, instances, etc.
(
)
Maps.asPrettyJsonString
BeanUtils.asPrettyJsonString (can pass custom mapper)
Lists.asPrettyJsonString
Sets.asPrettyJsonString
BeanUtils.asPrettyJsonString (can pass custom mapper)
Lists.asPrettyJsonString
Sets.asPrettyJsonString
Most people will want to use Boon.toPrettyJson
I am sure there are bugs, but it works mostly now. More testing needed of course.
{
"name" : "Rick",
"age" : 45,
"wife" : {
"name" : "Diana"
},
"children" : [ {
"name" : "Whitney"
}, {
"name" : "Maya"
}, {
"name" : "Lucas"
}, {
"name" : "Ryan"
}, {
"name" : "Noah"
}],
"fruit" : ["apple","orange","strawberry"]
}
No comments:
Post a Comment