Java Gson exclude fields using ExclusionStrategy interface
In this Java Gson tutorial we learn how to exclude fields during serialization or deserialize JSON by using the ExclusionStrategy interface. Via step by step tutorial we will show you how to use the GsonBuilder.setExclusionStrategies() method and com.google.gson.ExclusionStrategy interface to configure Gson to exclude fields based on custom implementation.