Thanks, @pakoito, I followed your links and suggestions, but I'm still stuck with deserialization, I retrieve nulls instead of None values… My goal is quite simple: I just want to persist a data class containing Options in shared preferences (android). Maybe using Gson for that purpose is not the right idea, do you know of alternative ways to do that?