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

java.lang.Object
com.pixelmonmod.api.ParseAttemptTypeAdapter<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<ParseAttempt<A>>, com.google.gson.JsonSerializer<ParseAttempt<A>>

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

    • ParseAttemptTypeAdapter

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

    • deserialize

      public ParseAttempt<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(ParseAttempt<A> spec, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
      Specified by:
      serialize in interface com.google.gson.JsonSerializer<A extends Specification<B,C>>