Class JsonSerializing.GsonSerializer<E,T extends JsonSerializableType<E>>

java.lang.Object
net.minecraft.util.JsonSerializing.GsonSerializer<E,T>
All Implemented Interfaces:
JsonDeserializer<E>, JsonSerializer<E>
Enclosing class:
JsonSerializing

private static class JsonSerializing.GsonSerializer<E,T extends JsonSerializableType<E>> extends Object implements JsonDeserializer<E>, JsonSerializer<E>
Mappings:
Namespace Name
official dkz$c
intermediary net/minecraft/class_5330$class_5333
named net/minecraft/util/JsonSerializing$GsonSerializer
  • Field Details

    • registry

      private final Registry<T extends JsonSerializableType<E>> registry
      Mappings:
      Namespace Name Mixin selector
      official a Ldkz$c;a:Lhb;
      intermediary field_25197 Lnet/minecraft/class_5330$class_5333;field_25197:Lnet/minecraft/class_2378;
      named registry Lnet/minecraft/util/JsonSerializing$GsonSerializer;registry:Lnet/minecraft/util/registry/Registry;
    • rootFieldName

      private final String rootFieldName
      Mappings:
      Namespace Name Mixin selector
      official b Ldkz$c;b:Ljava/lang/String;
      intermediary field_25198 Lnet/minecraft/class_5330$class_5333;field_25198:Ljava/lang/String;
      named rootFieldName Lnet/minecraft/util/JsonSerializing$GsonSerializer;rootFieldName:Ljava/lang/String;
    • idFieldName

      private final String idFieldName
      Mappings:
      Namespace Name Mixin selector
      official c Ldkz$c;c:Ljava/lang/String;
      intermediary field_25199 Lnet/minecraft/class_5330$class_5333;field_25199:Ljava/lang/String;
      named idFieldName Lnet/minecraft/util/JsonSerializing$GsonSerializer;idFieldName:Ljava/lang/String;
    • typeGetter

      private final Function<E,T extends JsonSerializableType<E>> typeGetter
      Mappings:
      Namespace Name Mixin selector
      official d Ldkz$c;d:Ljava/util/function/Function;
      intermediary field_25200 Lnet/minecraft/class_5330$class_5333;field_25200:Ljava/util/function/Function;
      named typeGetter Lnet/minecraft/util/JsonSerializing$GsonSerializer;typeGetter:Ljava/util/function/Function;
    • defaultType

      @Nullable private final T extends JsonSerializableType<E> defaultType
      Mappings:
      Namespace Name Mixin selector
      official e Ldkz$c;e:Ldlj;
      intermediary field_28445 Lnet/minecraft/class_5330$class_5333;field_28445:Lnet/minecraft/class_5336;
      named defaultType Lnet/minecraft/util/JsonSerializing$GsonSerializer;defaultType:Lnet/minecraft/util/JsonSerializableType;
    • elementSerializer

      @Nullable private final @Nullable com.mojang.datafixers.util.Pair<T extends JsonSerializableType<E>,JsonSerializing.ElementSerializer<? extends E>> elementSerializer
      Mappings:
      Namespace Name Mixin selector
      official f Ldkz$c;f:Lcom/mojang/datafixers/util/Pair;
      intermediary field_25201 Lnet/minecraft/class_5330$class_5333;field_25201:Lcom/mojang/datafixers/util/Pair;
      named elementSerializer Lnet/minecraft/util/JsonSerializing$GsonSerializer;elementSerializer:Lcom/mojang/datafixers/util/Pair;
  • Constructor Details

    • GsonSerializer

      GsonSerializer(Registry<T> registry, String rootFieldName, String idFieldName, Function<E,T> typeGetter, @Nullable T defaultType, @Nullable @Nullable com.mojang.datafixers.util.Pair<T,JsonSerializing.ElementSerializer<? extends E>> elementSerializer)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldkz$c;<init>(Lhb;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Function;Ldlj;Lcom/mojang/datafixers/util/Pair;)V
      intermediary <init> Lnet/minecraft/class_5330$class_5333;<init>(Lnet/minecraft/class_2378;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Function;Lnet/minecraft/class_5336;Lcom/mojang/datafixers/util/Pair;)V
      named <init> Lnet/minecraft/util/JsonSerializing$GsonSerializer;<init>(Lnet/minecraft/util/registry/Registry;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Function;Lnet/minecraft/util/JsonSerializableType;Lcom/mojang/datafixers/util/Pair;)V
  • Method Details

    • deserialize

      public E deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException
      Specified by:
      deserialize in interface JsonDeserializer<E>
      Throws:
      JsonParseException
      Mappings:
      Namespace Name Mixin selector
      official deserialize Ldkz$c;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
      intermediary deserialize Lnet/minecraft/class_5330$class_5333;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
      named deserialize Lnet/minecraft/util/JsonSerializing$GsonSerializer;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
    • serialize

      public JsonElement serialize(E object, Type type, JsonSerializationContext context)
      Specified by:
      serialize in interface JsonSerializer<E>
      Mappings:
      Namespace Name Mixin selector
      official serialize Ldkz$c;serialize(Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
      intermediary serialize Lnet/minecraft/class_5330$class_5333;serialize(Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
      named serialize Lnet/minecraft/util/JsonSerializing$GsonSerializer;serialize(Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;