io.gitee.huangguiming.Imcode.adapter.IMGetAllGroupResponsesAdapter Maven / Gradle / Ivy
package io.gitee.huangguiming.Imcode.adapter;
import com.google.gson.*;
import io.gitee.huangguiming.Imcode.responses.IMGetAllGroupResponses;
import io.gitee.huangguiming.Imcode.utils.GsonHelper;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.Objects;
public class IMGetAllGroupResponsesAdapter implements JsonDeserializer {
@Override
public IMGetAllGroupResponses deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject o = json.getAsJsonObject();
IMGetAllGroupResponses imGetAllGroupResponses = new IMGetAllGroupResponses();
imGetAllGroupResponses.setActionStatus(GsonHelper.getString(o,"ActionStatus"));
imGetAllGroupResponses.setGroupIdList(GsonHelper.getStringList(o, "GroupIdList"));
imGetAllGroupResponses.setErrorCode(GsonHelper.getInteger(o,"ErrorCode"));
imGetAllGroupResponses.setErrorInfo(GsonHelper.getString(o,"ErrorInfo"));
imGetAllGroupResponses.setTotalCount(GsonHelper.getInteger(o,"TotalCount"));
imGetAllGroupResponses.setNext(GsonHelper.getInteger(o,"Next"));
return imGetAllGroupResponses;
}
}