翰林优商.apk(点击下载) / AllRBInfo.java


package com.mobile.auth.gatewayauth.model.psc_info_upload;

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 AllRBInfo implements Jsoner {
    private static final String KEY_RESPONSE = "alibaba_aliqin_pns_vendor_querylist_response";
    private static final String KEY_TOP_ERROR_RESPONSE = "error_response";
    private TopErrorResponse errorResponse;
    private PnsVendorQueryResponse response;

    public static AllRBInfo fromJson(String str) {
        try {
            if (!TextUtils.isEmpty(str)) {
                return (AllRBInfo) JSONUtils.fromJson(new JSONObject(str), (JsonType) new JsonType<AllRBInfo>() {
                    /* class com.mobile.auth.gatewayauth.model.psc_info_upload.AllRBInfo.AnonymousClass1 */
                }, (List<Field>) null);
            }
        } catch (JSONException e) {
            try {
                e.printStackTrace();
            } catch (Throwable th) {
                ExceptionProcessor.processException(th);
                return null;
            }
        }
        return null;
    }

    @Override // com.nirvana.tools.jsoner.Jsoner
    public void fromJson(JSONObject jSONObject) {
        if (jSONObject != null) {
            try {
                setResponse((PnsVendorQueryResponse) JSONUtils.fromJson(jSONObject.optJSONObject(KEY_RESPONSE), (JsonType) new JsonType<PnsVendorQueryResponse>() {
                    /* class com.mobile.auth.gatewayauth.model.psc_info_upload.AllRBInfo.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_info_upload.AllRBInfo.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 PnsVendorQueryResponse 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(PnsVendorQueryResponse pnsVendorQueryResponse) {
        try {
            this.response = pnsVendorQueryResponse;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    @Override // com.nirvana.tools.jsoner.Jsoner
    public JSONObject toJson() {
        try {
            JSONObject jSONObject = new JSONObject();
            try {
                PnsVendorQueryResponse pnsVendorQueryResponse = this.response;
                jSONObject.put(KEY_RESPONSE, pnsVendorQueryResponse == null ? new JSONObject() : pnsVendorQueryResponse.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;
        }
    }
}