Class ActionAdapter

java.lang.Object
com.google.gson.TypeAdapter<Action>
dev.foxikle.customnpcs.actions.conditions.ActionAdapter

public class ActionAdapter extends com.google.gson.TypeAdapter<Action>
A TypeAdapter for Gson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read(com.google.gson.stream.JsonReader in)
    deserializes an Action
    void
    write(com.google.gson.stream.JsonWriter out, Action value)
    Serializes the Action object to json

    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

    • ActionAdapter

      public ActionAdapter()
  • Method Details

    • write

      public void write(com.google.gson.stream.JsonWriter out, Action value) throws IOException
      Serializes the Action object to json
      Specified by:
      write in class com.google.gson.TypeAdapter<Action>
      Parameters:
      out - The json writer
      value - the Java object to write. May be null.
      Throws:
      IOException - if an IOException occours
    • read

      public Action read(com.google.gson.stream.JsonReader in) throws IOException
      deserializes an Action
      Specified by:
      read in class com.google.gson.TypeAdapter<Action>
      Parameters:
      in - the object, in reader form
      Returns:
      the deserialized action
      Throws:
      IOException - if an error occoured