I'm having the need to serialize and deserialize an attribute that your Json reference has a different name. For example, in the Json I am receiving there is a text
field and I would like the value of this attribute to be filled in my attribute named descricao
.
This would not normally happen since the Gson framework relates fields and attributes with equal names, meaning Gson will look in my Java class for a text
attribute to enter the value of the text
attribute of Json, but the My case is different.
I also question if it is possible to do the same thing when serializing an object, for example by taking the value that is in the descricao
field and inserting it into a text
element of Json.
Is all this possible? If so, how could this be done?