Home / Companies / Starburst / Blog / Post Details
Content Deep Dive

Deserialization part 2

Blog post from Starburst

Post Details
Company
Date Published
Author
Jordan Zimmerman
Word Count
2,391
Language
English
Hacker News Points
-
Summary

In the continuation of the "Bleeding Edge Java" series, the article explores the advanced techniques of deserializing complex Java types, building on the foundational framework discussed in the first part. The process involves updating the implementation of `deserializerFor` to handle a variety of types, including collections, optionals, records, and enumerations, by using specific patterns and deserialization strategies for each type. It introduces the concept of "type tokens" to manage generic types during runtime, despite Java's type erasure, allowing for the deserialization of complex structures like lists of records or optionals. The article culminates in a practical demonstration using `jshell` to serialize a Java record to JSON tokens and then deserialize it back to ensure the integrity of the process, showcasing a complete round-trip conversion between Java objects and JSON. The series invites readers to test the code and highlights the potential of these techniques in real-world applications, also extending an invitation to join the Starburst team.