POJO class for persistence:
class Target{
private Integer status;
private Integer autoLink;
// other fields
}
Input Json format :
Target
{
"status":"Executed",
"autoLinkIndicator":"YES"
//other fields
}
How do parse through the JSON and change the values of the fields before persisting?
Eg:
if I see "status":"Executed",
I want to change it to "status":1 and "status":"Terminated" -> "status":0
Similarily, for "autoLinkIndicator"
1 for "YES", 0 for "NO"
Currently, Using gson for parsing json into Target class.