Exclude Fields from Serialization in Gson 1. Overview In this short tutorial, we’re going to explore the available options for excluding one or more fields of a Java class and its subclasses from Gson serialization. 2. Initial Setup Let’s first define our classes: @Data @AllArgsConstructor public class MyClass { private… Continue Reading gson-exclude-fields-serialization

Gson Serialization Cookbook In this article we’re going to look at the most common scenarios of serialization using the Gson library. Let’s start by introducing a simple entity that we’re going to use throughout the following examples: public class SourceClass { private int intValue; private String stringValue; // standard getters… Continue Reading gson-serialization-guide