Class WarnEntry.IWarnEntryAdapter

java.lang.Object
com.google.gson.TypeAdapter<IWarnEntry>
me.github.simonplays15.betterbansystem.core.warn.WarnEntry.IWarnEntryAdapter
Enclosing class:
WarnEntry

public static class WarnEntry.IWarnEntryAdapter extends com.google.gson.TypeAdapter<IWarnEntry>
The IWarnEntryAdapter class is a TypeAdapter for serializing and deserializing IWarnEntry objects to and from JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read (@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

    Methods inherited from class java.lang.Object

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