Class BanEntry.IBanEntryAdapter
java.lang.Object
com.google.gson.TypeAdapter<IBanEntry>
me.github.simonplays15.betterbansystem.core.ban.BanEntry.IBanEntryAdapter
- Enclosing class:
- BanEntry
The IBanEntryAdapter class is a TypeAdapter for serializing and deserializing
IBanEntry objects using Gson.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread
(@NotNull com.google.gson.stream.JsonReader reader) Reads a JSON object from a JsonReader and creates a new IBanEntry instance based on the read data.void
Writes the JSON representation of an IBanEntry object to a JsonWriter.Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Constructor Details
-
IBanEntryAdapter
public IBanEntryAdapter()
-
-
Method Details
-
write
public void write(@NotNull @NotNull com.google.gson.stream.JsonWriter writer, @NotNull @NotNull IBanEntry entry) throws IOException Writes the JSON representation of an IBanEntry object to a JsonWriter.- Specified by:
write
in classcom.google.gson.TypeAdapter<IBanEntry>
- Parameters:
writer
- The JsonWriter used to write the JSON data. Cannot be null.entry
- The IBanEntry object to be written. Cannot be null.- Throws:
IOException
- If an error occurs while writing to the JsonWriter.
-
read
public IBanEntry read(@NotNull @NotNull com.google.gson.stream.JsonReader reader) throws IOException Reads a JSON object from a JsonReader and creates a new IBanEntry instance based on the read data.- Specified by:
read
in classcom.google.gson.TypeAdapter<IBanEntry>
- Parameters:
reader
- The JsonReader to read from. Cannot be null.- Returns:
- The newly created IBanEntry instance.
- Throws:
IOException
- If an error occurs while reading from the JsonReader.
-