I have a following JsonArray file
[
{
"DateSent": "06/22/2014 11:09:11",
"UserName": "santosh"
}
]
And I am mapping it to the following AssistResponse class
public class AssistResponse {
@SerializedName("DateSent")
private String dateSent;
@SerializedName("UserName")
public String userName;
public void setDateSent(String dateSent) {
this.dateSent = dateSent;
System.out.println(this.dateSent);
}
public String getDateSent() {
return this.dateSent;
}
}
I can easily get List or Array of this class.But I do want to modify the dateSent property of classAssistResponse while Gson maps the class. Meaning Gson, do parse the Jsonfile, then assigns the value to the @SerializedName.So while assigning the value, I need to change the dateSent value. The dateSent contains the server date value,but I want to change it to the local time. I can use the parsed List and then iterate it and get dateSent value and then change it. But, is it possible to change the value, during the parsing of Json by Gson, so that at the end I don't have to again iterate the whole Array
Thanks