I have the following HashMap:
HashMap fileObj = new HashMap();
ArrayList cols
you can also use JSON file to read and write MAP object.
To write map object into JSON file
ObjectMapper mapper = new ObjectMapper();
Map map = new HashMap();
map.put("name", "Suson");
map.put("age", 26);
// write JSON to a file
mapper.writeValue(new File("c:\\myData.json"), map);
To read map object from JSON file
ObjectMapper mapper = new ObjectMapper();
// read JSON from a file
Map map = mapper.readValue(
new File("c:\\myData.json"),
new TypeReference
and import ObjectMapper from com.fasterxml.jackson and put code in try catch block