I am trying to unzip a json file so that some Json properties are displayed in the HashMap, which is present in my model class. The reserve of properties is mapped to the corresponding fields of the class. Json below:
{ "_id":2, "Name":"xyz", "Age":20, "MEMO_TEXT":"yyy", "MEMO_LINK":"zzz", "MEMO_DOB":"", "MEMO_USERNAME":"linie orange", "MEMO_CATEGORY":2, "MEMO_UID":"B82071415B07495F9DD02C152E4805EC" }
And here is the Model class that I want to apply this Json to:
public class Model{ private int _id; private String name; private int age private HashMap<String, String> columns;
So, here I want to get a columns map that contains the keys "MEMO_TEXT","MEMO_LINK","MEMO_DOB","MEMO_USERNAME","MEMO_CATEGORY","MEMO_UID"
and other properties in Json are mapped to the appropriate fields.
Can this be done using Jackson's ObjectMapper library?
source share