Class TaskTypeAdapter

java.lang.Object
com.thoughtworks.go.plugin.configrepo.codec.TypeAdapter
com.thoughtworks.go.plugin.configrepo.codec.TaskTypeAdapter
All Implemented Interfaces:
com.google.gson.JsonDeserializer<CRTask>, com.google.gson.JsonSerializer<CRTask>

public class TaskTypeAdapter
extends TypeAdapter
implements com.google.gson.JsonDeserializer<CRTask>, com.google.gson.JsonSerializer<CRTask>
  • Field Summary

    Fields inherited from class com.thoughtworks.go.plugin.configrepo.codec.TypeAdapter

    ARTIFACT_ORIGIN
  • Constructor Summary

    Constructors
    Constructor Description
    TaskTypeAdapter()  
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.Class<?> classForName​(java.lang.String typeName, java.lang.String origin)  
    CRTask deserialize​(com.google.gson.JsonElement json, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext context)  
    com.google.gson.JsonElement serialize​(CRTask crTask, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext context)  

    Methods inherited from class com.thoughtworks.go.plugin.configrepo.codec.TypeAdapter

    determineJsonElementForDistinguishingImplementers

    Methods inherited from class java.lang.Object

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

    • TaskTypeAdapter

      public TaskTypeAdapter()
  • Method Details

    • deserialize

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

      protected java.lang.Class<?> classForName​(java.lang.String typeName, java.lang.String origin)
      Specified by:
      classForName in class TypeAdapter
    • serialize

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