Class SpecificationTypeAdapter<A extends Specification<B,C>,B,C>

java.lang.Object
com.pixelmonmod.api.SpecificationTypeAdapter<A,B,C>
Type Parameters:
A - The specification implementation type
B - The reforged data type
C - The minecraft type
All Implemented Interfaces:
com.google.gson.JsonDeserializer<A>, com.google.gson.JsonSerializer<A>

public class SpecificationTypeAdapter<A extends Specification<B,C>,B,C> extends Object implements com.google.gson.JsonSerializer<A>, com.google.gson.JsonDeserializer<A>
Type adapter implementation for writing any form of Specification to JSON
  • Constructor Details

    • SpecificationTypeAdapter

      public SpecificationTypeAdapter(Class<A> clazz)
  • Method Details

    • deserialize

      public A deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
      Specified by:
      deserialize in interface com.google.gson.JsonDeserializer<A extends Specification<B,C>>
      Throws:
      com.google.gson.JsonParseException
    • serialize

      public com.google.gson.JsonElement serialize(A spec, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<A extends Specification<B,C>>