My class is like:
class Foo { public String duration; public String height; }
And my json data looks like
{"duration":"12200000", "height":"162"}
Now i want to deserialize it
Foo foo = gson.fromJson(jsonStr, Foo.class);
So, foo.duration - "20 minutes" (number of minutes), foo.height - "162 cm"
Can this be done using Gson?
Thanks!
source share