I am using the Gson library to make Json objects. I made a serializer for my Class. From what I see I have to use the builder and do .registerTypeAdapter on it whenever I want to use my serializer.
Is there a way around this? Is there a way to have the serializer I wrote implicitly associated with my class? If not what do people usually do to keep their code clean when using their own serializers?
Not with Gson.
Use Jackson. With Jackson, there are multiple ways to register serializers.