Class WarnEntry.IWarnEntryAdapter
java.lang.Object
com.google.gson.TypeAdapter<IWarnEntry>
me.github.simonplays15.betterbansystem.core.warn.WarnEntry.IWarnEntryAdapter
- Enclosing class:
- WarnEntry
The IWarnEntryAdapter class is a TypeAdapter for serializing and deserializing
IWarnEntry objects to and from JSON.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread
(@NotNull com.google.gson.stream.JsonReader reader) Reads a JSON representation of a warning entry and converts it into an IWarnEntry object.void
write
(@NotNull com.google.gson.stream.JsonWriter writer, @NotNull IWarnEntry entry) Writes an IWarnEntry object to JSON using a JsonWriter.Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Constructor Details
-
IWarnEntryAdapter
public IWarnEntryAdapter()
-
-
Method Details
-
write
public void write(@NotNull @NotNull com.google.gson.stream.JsonWriter writer, @NotNull @NotNull IWarnEntry entry) throws IOException Writes an IWarnEntry object to JSON using a JsonWriter.- Specified by:
write
in classcom.google.gson.TypeAdapter<IWarnEntry>
- Parameters:
writer
- The JsonWriter object to write to.entry
- The IWarnEntry object to write.- Throws:
IOException
- if an I/O error occurs while writing to the JsonWriter.
-
read
public IWarnEntry read(@NotNull @NotNull com.google.gson.stream.JsonReader reader) throws IOException Reads a JSON representation of a warning entry and converts it into an IWarnEntry object.- Specified by:
read
in classcom.google.gson.TypeAdapter<IWarnEntry>
- Parameters:
reader
- The JSON reader to read the input from.- Returns:
- An IWarnEntry object representing the deserialized warning entry.
- Throws:
IOException
- If an I/O error occurs while reading the JSON data.
-