package com.mobile.auth.gatewayauth.model.psc_certify_id; 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 com.nirvana.tools.jsoner.JsonerTag; import java.lang.reflect.Field; import java.util.List; import org.json.JSONException; import org.json.JSONObject; public class GetCertifyIdRB implements Jsoner { private static final String KEY_RESPONSE = "alibaba_aliqin_ta_pns_living_create_response"; private static final String KEY_TOP_ERROR_RESPONSE = "error_response"; @JsonerTag(keyName = KEY_TOP_ERROR_RESPONSE) private TopErrorResponse errorResponse; @JsonerTag(keyName = KEY_RESPONSE) private GetCertifyIdTopResponse response; @Override // com.nirvana.tools.jsoner.Jsoner public void fromJson(JSONObject jSONObject) { if (jSONObject != null) { try { setResponse((GetCertifyIdTopResponse) JSONUtils.fromJson(jSONObject.optJSONObject(KEY_RESPONSE), (JsonType) new JsonType<GetCertifyIdTopResponse>() { /* class com.mobile.auth.gatewayauth.model.psc_certify_id.GetCertifyIdRB.AnonymousClass1 */ }, (List<Field>) null)); setErrorResponse((TopErrorResponse) JSONUtils.fromJson(jSONObject.optJSONObject(KEY_TOP_ERROR_RESPONSE), (JsonType) new JsonType<TopErrorResponse>() { /* class com.mobile.auth.gatewayauth.model.psc_certify_id.GetCertifyIdRB.AnonymousClass2 */ }, (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 GetCertifyIdTopResponse 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(GetCertifyIdTopResponse getCertifyIdTopResponse) { try { this.response = getCertifyIdTopResponse; } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.nirvana.tools.jsoner.Jsoner public JSONObject toJson() { try { JSONObject jSONObject = new JSONObject(); try { GetCertifyIdTopResponse getCertifyIdTopResponse = this.response; jSONObject.put(KEY_RESPONSE, getCertifyIdTopResponse == null ? new JSONObject() : getCertifyIdTopResponse.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; } } }