package com.mobile.auth.gatewayauth.model.psc_sdk_config; import android.text.TextUtils; import com.mobile.auth.gatewayauth.ExceptionProcessor; import com.mobile.auth.gatewayauth.model.TopErrorResponse; import com.nirvana.tools.jsoner.JSONUtils; import com.nirvana.tools.jsoner.JsonType; import com.nirvana.tools.jsoner.Jsoner; import java.lang.reflect.Field; import java.util.List; import org.json.JSONException; import org.json.JSONObject; public class ConfigRB implements Jsoner { private static final String KEY_RESPONSE = "alibaba_aliqin_psc_query_config_response"; private static final String KEY_TOP_ERROR_RESPONSE = "error_response"; private TopErrorResponse errorResponse; private PscQueryConfigResponse response; public static ConfigRB fromJson(String str) { try { ConfigRB configRB = new ConfigRB(); try { if (!TextUtils.isEmpty(str)) { return (ConfigRB) JSONUtils.fromJson(new JSONObject(str), (JsonType) new JsonType<ConfigRB>() { /* class com.mobile.auth.gatewayauth.model.psc_sdk_config.ConfigRB.AnonymousClass1 */ }, (List<Field>) null); } } catch (JSONException e) { e.printStackTrace(); } return configRB; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } @Override // com.nirvana.tools.jsoner.Jsoner public void fromJson(JSONObject jSONObject) { if (jSONObject != null) { try { setResponse((PscQueryConfigResponse) JSONUtils.fromJson(jSONObject.optJSONObject(KEY_RESPONSE), (JsonType) new JsonType<PscQueryConfigResponse>() { /* class com.mobile.auth.gatewayauth.model.psc_sdk_config.ConfigRB.AnonymousClass2 */ }, (List<Field>) null)); setErrorResponse((TopErrorResponse) JSONUtils.fromJson(jSONObject.optJSONObject(KEY_TOP_ERROR_RESPONSE), (JsonType) new JsonType<TopErrorResponse>() { /* class com.mobile.auth.gatewayauth.model.psc_sdk_config.ConfigRB.AnonymousClass3 */ }, (List<Field>) null)); } catch (Throwable th) { ExceptionProcessor.processException(th); } } } public TopErrorResponse getErrorResponse() { try { return this.errorResponse; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public PscQueryConfigResponse getResponse() { try { return this.response; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public void setErrorResponse(TopErrorResponse topErrorResponse) { try { this.errorResponse = topErrorResponse; } catch (Throwable th) { ExceptionProcessor.processException(th); } } public void setResponse(PscQueryConfigResponse pscQueryConfigResponse) { try { this.response = pscQueryConfigResponse; } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.nirvana.tools.jsoner.Jsoner public JSONObject toJson() { try { JSONObject jSONObject = new JSONObject(); try { PscQueryConfigResponse pscQueryConfigResponse = this.response; jSONObject.put(KEY_RESPONSE, pscQueryConfigResponse == null ? new JSONObject() : pscQueryConfigResponse.toJson()); TopErrorResponse topErrorResponse = this.errorResponse; jSONObject.put(KEY_TOP_ERROR_RESPONSE, topErrorResponse == null ? new JSONObject() : topErrorResponse.toJson()); } catch (JSONException e) { e.printStackTrace(); } return jSONObject; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } }