@@ -0,0 +1,1142 @@
+package com.kii.thingif.internal.gson;%0A%0Aimport com.google.gson.Gson;%0Aimport com.google.gson.JsonDeserializationContext;%0Aimport com.google.gson.JsonDeserializer;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonObject;%0Aimport com.google.gson.JsonParseException;%0Aimport com.kii.thingif.TargetState;%0Aimport com.kii.thingif.query.HistoryState;%0A%0Aimport java.lang.reflect.Type;%0Aimport java.util.Date;%0A%0Apublic class HistoryStateAdapter implements JsonDeserializer%3CHistoryState%3E %7B%0A%0A    private Class%3C? extends TargetState%3E stateClass;%0A%0A    public HistoryStateAdapter(Class%3C? extends TargetState%3E stateClass) %7B%0A        this.stateClass = stateClass;%0A    %7D%0A%0A    @Override%0A    public HistoryState deserialize(JsonElement jsonElement, Type typeOfT, JsonDeserializationContext context) throws JsonParseException %7B%0A        if (jsonElement == null %7C%7C !jsonElement.isJsonObject())return null;%0A        JsonObject json = jsonElement.getAsJsonObject();%0A        TargetState state = new Gson().fromJson(json, stateClass);%0A        Long createdAt = json.get(%22_created%22).getAsLong();%0A        return new HistoryState(state, new Date(createdAt));%0A    %7D%0A%7D%0A

Add HistoryStateAdapter to deserialize json object to HistoryState instance.