Convert JSON string to HashMap in Java -
how can convert json string hashmap. json string like
{ "availabledeliveries": { "500": { "code": "inoffice", "desc": "in office", "id": 500, "name": "in office" }, "502": { "code": "telephone", "desc": "telephone", "id": 502, "name": "telephone" }, "503": { "code": "diy doc access", "desc": "online documents", "id": 503, "name": "diy doc access" } } }
i looked on other examples have collection of object have top level object "availabledeliveries" not sure how handle level.
import jackson-all-1.8.2.jar create mapper object mapper
objectmapper objectmapper = new objectmapper();
create hashmap
map = objectmapper.readvalue( json, hashmap.class );
hope work
Comments
Post a Comment