我有一个HashMap
对象,我想使用com.fasterxml.jackson.databind.ObjectMapper
将其转换为JsonNode
树.做这件事最好的方法是什么?
I found the following code but since I don't know the Jackson API well, I wonder if there are some better ways.
mapper.reader().readTree(mapper.writeValueAsString(hashmap))