My scenario is very complicated but here\'s a summary:
I\'m trying to understand source of a compiler -- and to understand what each AST node represents, I\'m generating
Check runtimeAdapter ,
RuntimeTypeAdapter nodeAdapter = RuntimeTypeAdapter.create(Node.class,"type");
nodeAdapter.registerSubtype(Begin.class,"Begin");
nodeAdapter.registerSubtype(State.class,"State");
gsonBuilder.registerTypeHierarchyAdapter(Class.class, new GsonClassAdapter())
.registerTypeAdapter(Node.class,nodeAdapter )
.enableComplexMapKeySerialization().setPrettyPrinting();
gson = gsonBuilder.create();