@Override public void setupGsonSerialiser(GsonBuilder gsonBuilder) { new PrivateFields<GsonBuilder, Excluder>(GsonBuilder.class, new Obf("excluder") {}) {} .set(gsonBuilder, Excluder.DEFAULT); // grr gsonBuilder .registerTypeAdapterFactory(new EnumTypeAdapterFactory()) .registerTypeHierarchyAdapter(Value.class, new ValueSerializer()); }
public IMetadataSerializer() { this.gsonBuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); this.gsonBuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); }
public MetadataSerializer() { this.gsonBuilder.registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer()); this.gsonBuilder.registerTypeHierarchyAdapter(Style.class, new Style.Serializer()); this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); }
@Override public void setupGsonSerialiser(GsonBuilder gsonBuilder) { super.setupGsonSerialiser(gsonBuilder); gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); }