java.lang.Object
com.marginallyclever.nodegraphcore.json.NodeGraphJsonAdapter
All Implemented Interfaces:
com.google.gson.JsonDeserializer<NodeGraph>, com.google.gson.JsonSerializer<NodeGraph>

public class NodeGraphJsonAdapter
extends java.lang.Object
implements com.google.gson.JsonSerializer<NodeGraph>, com.google.gson.JsonDeserializer<NodeGraph>
Since:
2022-02-23
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.reflect.Type nodeType
    Needed by Gson.
  • Constructor Summary

    Constructors
    Constructor Description
    NodeGraphJsonAdapter()  
  • Method Summary

    Modifier and Type Method Description
    NodeGraph deserialize​(com.google.gson.JsonElement jsonElement, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext context)  
    com.google.gson.JsonElement serialize​(NodeGraph graph, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext context)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nodeType

      public static final java.lang.reflect.Type nodeType
      Needed by Gson.
  • Constructor Details

    • NodeGraphJsonAdapter

      public NodeGraphJsonAdapter()
  • Method Details

    • serialize

      public com.google.gson.JsonElement serialize​(NodeGraph graph, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext context)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<NodeGraph>
    • deserialize

      public NodeGraph deserialize​(com.google.gson.JsonElement jsonElement, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
      Specified by:
      deserialize in interface com.google.gson.JsonDeserializer<NodeGraph>
      Throws:
      com.google.gson.JsonParseException