Package io.github.mrtesz.teszcore.json
Class TeszGson
java.lang.Object
io.github.mrtesz.teszcore.json.TeszGson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tstatic <T> Tstatic <T> Tstatic <T> Tstatic voidrebuild()Rebuilds thegsonwithBUILDER#createstatic <T> voidregisterDeserializer(Class<T> type, com.google.gson.JsonDeserializer<T> deserializer) static <T> voidregisterSerializer(Class<T> type, com.google.gson.JsonSerializer<T> serializer) static <T> voidregisterTypeAdapter(Class<T> type, Object adapter) static voidsetBUILDER(com.google.gson.GsonBuilder BUILDER) Deprecated, for removal: This API element is subject to removal in a future version.static Stringstatic String
-
Constructor Details
-
TeszGson
public TeszGson()
-
-
Method Details
-
rebuild
public static void rebuild()Rebuilds thegsonwithBUILDER#create -
toJson
-
toJson
-
fromJson
-
fromJson
-
fromJson
-
fromJson
-
registerSerializer
public static <T> void registerSerializer(Class<T> type, com.google.gson.JsonSerializer<T> serializer) -
registerDeserializer
public static <T> void registerDeserializer(Class<T> type, com.google.gson.JsonDeserializer<T> deserializer) -
registerTypeAdapter
-
setBUILDER
@Deprecated(since="2.2.1", forRemoval=true) public static void setBUILDER(com.google.gson.GsonBuilder BUILDER) Deprecated, for removal: This API element is subject to removal in a future version.– useand modify the returned builder - Reason: Resets all registered TypeAdaptersinvalid reference
#getBUILDERSets the builder used to create new Gson instances.Warning: This resets all previously registered TypeAdapters. The Gson instance will be rebuilt using the provided builder.
- Parameters:
BUILDER- the newGsonBuilderto use for creating Gson instances
-
invalid reference