Gson deserialize interface to its Class implementation
问题 I am using Retrofit 2.1.0 with converter-gson:2.1.0 and separately gson:2.6.2 in order to customize the serialization/deserialization. The problem is that my POJOs should be hidden behind interfaces and I want to tell Gson which class should be the deserialized interface. And after the deserialization/ serialization Retrofit should be able to return the interface. It would be good if I can take advantage of Generics and easily create a way to tell Gson or Retrofit to serialize/deserialize