Class ArtifactTypeAdapter

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

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

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

    ARTIFACT_ORIGIN
  • Constructor Summary

    Constructors
    Constructor Description
    ArtifactTypeAdapter()  
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.Class<?> classForName​(java.lang.String typeName, java.lang.String origin)  
    CRArtifact deserialize​(com.google.gson.JsonElement json, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext context)  
    com.google.gson.JsonElement serialize​(CRArtifact crArtifact, 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

    • ArtifactTypeAdapter

      public ArtifactTypeAdapter()
  • Method Details

    • deserialize

      public CRArtifact 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<CRArtifact>
      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​(CRArtifact crArtifact, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext context)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<CRArtifact>