All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.chanjar.weixin.open.util.json.WxOpenAuthorizerOptionResultGsonAdapter Maven / Gradle / Ivy

The newest version!
package me.chanjar.weixin.open.util.json;

import com.google.gson.*;
import me.chanjar.weixin.common.util.json.GsonHelper;
import me.chanjar.weixin.open.bean.result.WxOpenAuthorizerOptionResult;

import java.lang.reflect.Type;

/**
 * @author 007
 */
public class WxOpenAuthorizerOptionResultGsonAdapter implements JsonDeserializer {
  @Override
  public WxOpenAuthorizerOptionResult deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
    WxOpenAuthorizerOptionResult authorizerOptionResult = new WxOpenAuthorizerOptionResult();
    JsonObject jsonObject = jsonElement.getAsJsonObject();
    authorizerOptionResult.setAuthorizerAppid(GsonHelper.getString(jsonObject, "authorizer_appid"));
    authorizerOptionResult.setOptionName(GsonHelper.getString(jsonObject, "option_name"));
    authorizerOptionResult.setOptionValue(GsonHelper.getString(jsonObject, "option_value"));
    return authorizerOptionResult;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy