static class JsonSerializing.GsonSerializer<E,T extends JsonSerializableType<E>> extends Object implements com.google.gson.JsonDeserializer<E>, com.google.gson.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(com.google.gson.JsonElement jsonElement,
Type type,
com.google.gson.JsonDeserializationContext jsonDeserializationContext) |
com.google.gson.JsonElement |
serialize(E e,
Type type,
com.google.gson.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