package com.massivecraft.factions.adapter; import java.lang.reflect.Type; import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; import com.massivecraft.massivecore.xlib.gson.JsonElement; import com.massivecraft.massivecore.xlib.gson.JsonParseException; import com.massivecraft.factions.Rel; public class RelAdapter implements JsonDeserializer { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // private static RelAdapter i = new RelAdapter(); public static RelAdapter get() { return i; } // -------------------------------------------- // // OVERRIDE // -------------------------------------------- // @Override public Rel deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return Rel.parse(json.getAsString()); } }