2013-04-22 09:37:53 +02:00
|
|
|
package com.massivecraft.factions.adapter;
|
2011-10-23 17:55:53 +02:00
|
|
|
|
|
|
|
import java.lang.reflect.Type;
|
|
|
|
|
2013-04-09 13:24:55 +02:00
|
|
|
import com.massivecraft.factions.Rel;
|
2014-09-13 10:24:49 +02:00
|
|
|
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;
|
2011-10-23 17:55:53 +02:00
|
|
|
|
2013-04-10 09:54:42 +02:00
|
|
|
public class RelAdapter implements JsonDeserializer<Rel>
|
2011-10-23 17:55:53 +02:00
|
|
|
{
|
2013-04-17 15:49:29 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private static RelAdapter i = new RelAdapter();
|
|
|
|
public static RelAdapter get() { return i; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2011-10-23 17:55:53 +02:00
|
|
|
@Override
|
|
|
|
public Rel deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
|
|
|
|
{
|
|
|
|
return Rel.parse(json.getAsString());
|
|
|
|
}
|
2014-09-13 10:24:49 +02:00
|
|
|
|
2011-10-23 17:55:53 +02:00
|
|
|
}
|