gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
private static final Gson gson = new GsonBuilder().registerTypeAdapter(ILoadable.class,…
- User
private static final Gson gson = new GsonBuilder().registerTypeAdapter(ILoadable.class, new LoadableSerializer()).setPrettyPrinting().create();
If I had a class that implemented ILoadable, would it be serialized through this LoadableSerializer?
- Assistant
Yes, if you have a class that implements the interface and you attempt to serialize an instance of that class using the instance you configured, it will indeed be serialized through the that you registered in the .