Class AnimationTypeAdapter
java.lang.Object
io.github.kosmx.emotes.common.serializer.gson.AnimationTypeAdapter
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<com.zigythebird.playeranimcore.animation.Animation>, com.google.gson.JsonSerializer<com.zigythebird.playeranimcore.animation.Animation>
public final class AnimationTypeAdapter
extends Object
implements com.google.gson.JsonSerializer<com.zigythebird.playeranimcore.animation.Animation>, com.google.gson.JsonDeserializer<com.zigythebird.playeranimcore.animation.Animation>
(De)serializes an
Animation to the Emotecraft binary format as a Base64 JSON string, so an emote can be
embedded verbatim (e.g. in a config) rather than referenced by UUID. Ported from the Jackson variant; no downgrade.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncom.zigythebird.playeranimcore.animation.Animationdeserialize(com.google.gson.JsonElement json, Type type, com.google.gson.JsonDeserializationContext ctx) static com.zigythebird.playeranimcore.animation.AnimationfromBase64(String base64) static com.zigythebird.playeranimcore.animation.AnimationfromBytes(byte[] bytes) com.google.gson.JsonElementserialize(com.zigythebird.playeranimcore.animation.Animation src, Type type, com.google.gson.JsonSerializationContext ctx) static StringtoBase64(com.zigythebird.playeranimcore.animation.Animation animation) static byte[]toBytes(com.zigythebird.playeranimcore.animation.Animation animation)
-
Field Details
-
INSTANCE
-
-
Method Details
-
toBytes
public static byte[] toBytes(com.zigythebird.playeranimcore.animation.Animation animation) -
fromBytes
public static com.zigythebird.playeranimcore.animation.Animation fromBytes(byte[] bytes) -
toBase64
-
fromBase64
-
serialize
public com.google.gson.JsonElement serialize(com.zigythebird.playeranimcore.animation.Animation src, Type type, com.google.gson.JsonSerializationContext ctx) - Specified by:
serializein interfacecom.google.gson.JsonSerializer<com.zigythebird.playeranimcore.animation.Animation>
-
deserialize
public com.zigythebird.playeranimcore.animation.Animation deserialize(com.google.gson.JsonElement json, Type type, com.google.gson.JsonDeserializationContext ctx) throws com.google.gson.JsonParseException - Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<com.zigythebird.playeranimcore.animation.Animation>- Throws:
com.google.gson.JsonParseException
-