Class CommentTypeAdapter
java.lang.Object
net.darkhax.pricklemc.common.api.config.comment.CommentTypeAdapter
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<IComment>,com.google.gson.JsonSerializer<IComment>
public final class CommentTypeAdapter
extends Object
implements com.google.gson.JsonSerializer<IComment>, com.google.gson.JsonDeserializer<IComment>
A GSON type adapter that handles reading and writing comments through GSON. This will serialize the values from
IComment.getLines() and deserialize values to the basic Comment that only holds the data.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CommentTypeAdapterThe single instance of this type adapter. -
Method Summary
-
Field Details
-
INSTANCE
The single instance of this type adapter.
-
-
Method Details
-
deserialize
public IComment deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException - Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<IComment>- Throws:
com.google.gson.JsonParseException
-
serialize
public com.google.gson.JsonElement serialize(IComment src, Type typeOfSrc, com.google.gson.JsonSerializationContext context) - Specified by:
serializein interfacecom.google.gson.JsonSerializer<IComment>
-