Tag : Json

Java objects can be serialised to JSON strings and deserialised back using JsonSerializer (Article and Java Doc) and the JsonDeserializer (Article and Java Doc) respectively. These two classes simplify the translation between these two realms but add an extra layer which can be avoided. Instead of the JsonSerialiser or JsonDeserialiser we can use an instance of TypeAdapter (Java Doc) which can serialise and deserialise JSON objects efficiently as we will see in this article.

Albert Attard
Author: 4 years ago