Class ClassProcessingTypeAdapterFactory

java.lang.Object
google.registry.model.adapters.ClassProcessingTypeAdapterFactory
All Implemented Interfaces:
com.google.gson.TypeAdapterFactory

public class ClassProcessingTypeAdapterFactory extends Object implements com.google.gson.TypeAdapterFactory
Adapter factory that allows for (de)serialization of Class objects in GSON.

GSON's built-in adapter for Class objects throws an exception, but there are situations where we want to (de)serialize these, such as in VKeys. This instructs GSON to look for our custom ClassTypeAdapter rather than the default.

  • Constructor Details

    • ClassProcessingTypeAdapterFactory

      public ClassProcessingTypeAdapterFactory()
  • Method Details

    • create

      public <T> com.google.gson.TypeAdapter<T> create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> typeToken)
      Specified by:
      create in interface com.google.gson.TypeAdapterFactory