static class JsonSerializing.GsonSerializer<E,T extends JsonSerializableType<E>> extends Object implements JsonDeserializer<E>, JsonSerializer<E>
Modifier and Type | Field and Description |
---|---|
private com.mojang.datafixers.util.Pair<T,JsonSerializing.CustomSerializer<? extends E>> |
elementSerializer |
private String |
idFieldName |
private Registry<T> |
registry |
private String |
rootFieldName |
private Function<E,T> |
typeIdentification |
Modifier | Constructor and Description |
---|---|
private |
GsonSerializer(Registry<T> registry,
String rootFieldName,
String idFieldName,
Function<E,T> typeIdentification,
com.mojang.datafixers.util.Pair<T,JsonSerializing.CustomSerializer<? extends E>> pair) |
Modifier and Type | Method and Description |
---|---|
E |
deserialize(JsonElement jsonElement,
Type type,
JsonDeserializationContext jsonDeserializationContext) |
JsonElement |
serialize(E e,
Type type,
JsonSerializationContext jsonSerializationContext) |
private final Registry<T extends JsonSerializableType<E>> registry
private final String rootFieldName
private final String idFieldName
private final Function<E,T extends JsonSerializableType<E>> typeIdentification
@Nullable private final com.mojang.datafixers.util.Pair<T extends JsonSerializableType<E>,JsonSerializing.CustomSerializer<? extends E>> elementSerializer
public E deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext)
deserialize
in interface JsonDeserializer<E>
public JsonElement serialize(E e, Type type, JsonSerializationContext jsonSerializationContext)
serialize
in interface JsonSerializer<E>