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


package com.mobile.auth.gatewayauth.sdktools.upload.pns.model;

import com.mobile.auth.gatewayauth.ExceptionProcessor;
import com.nirvana.tools.jsoner.JSONUtils;
import com.nirvana.tools.jsoner.Jsoner;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;

public class BaseUploadDTO implements Jsoner, Serializable {
    private static final long serialVersionUID = -6155958494956658630L;
    private String osType = "Android";
    private String s;
    private Map<String, String> u;

    @Override // com.nirvana.tools.jsoner.Jsoner
    public void fromJson(JSONObject jSONObject) {
        try {
            JSONUtils.fromJson(jSONObject, this, (List<Field>) null);
            setU(JSONUtils.json2MapForStringString(jSONObject.optJSONObject("u")));
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
    }

    public String getOsType() {
        try {
            return this.osType;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public String getS() {
        try {
            return this.s;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public Map<String, String> getU() {
        try {
            return this.u;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public BaseUploadDTO setOsType(String str) {
        try {
            this.osType = str;
            return this;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public BaseUploadDTO setS(String str) {
        try {
            this.s = str;
            return this;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public BaseUploadDTO setU(Map<String, String> map) {
        try {
            this.u = map;
            return this;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    @Override // com.nirvana.tools.jsoner.Jsoner
    public JSONObject toJson() {
        try {
            JSONObject json = JSONUtils.toJson(this, null);
            try {
                json.put("u", new JSONObject(this.u));
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return json;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }

    public String toString() {
        try {
            return "BaseUploadDTO{u=" + this.u + ", s='" + this.s + '\'' + ", osType='" + this.osType + '\'' + '}';
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
            return null;
        }
    }
}