Class BanEntry.IBanEntryAdapter

java.lang.Object
com.google.gson.TypeAdapter<IBanEntry>
me.github.simonplays15.betterbansystem.core.ban.BanEntry.IBanEntryAdapter
Enclosing class:
BanEntry

public static class BanEntry.IBanEntryAdapter extends com.google.gson.TypeAdapter<IBanEntry>
The IBanEntryAdapter class is a TypeAdapter for serializing and deserializing IBanEntry objects using Gson.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read (@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
    write (@NotNull com.google.gson.stream.JsonWriter writer, @NotNull IBanEntry entry)
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 class com.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 class com.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.