AccountInfo.java 1.8 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.commons.json.JSONException
 *  org.apache.sling.commons.json.JSONObject
 */
package com.adobe.cq.mobile.phonegap.impl.build.metadata;

import com.adobe.cq.mobile.phonegap.impl.build.util.JSONUtil;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;

public class AccountInfo {
    private JSONObject data = null;

    public AccountInfo(JSONObject jsonAccountInfo) throws JSONException {
        this.data = jsonAccountInfo;
    }

    public String getId() {
        return JSONUtil.getSafeString(this.data, "id");
    }

    public String getUserName() {
        return JSONUtil.getSafeString(this.data, "username");
    }

    public String getEmail() {
        return JSONUtil.getSafeString(this.data, "email");
    }

    public String getLink() {
        return JSONUtil.getSafeString(this.data, "link");
    }

    public String getAppsLink() {
        String link = null;
        try {
            link = this.data.getJSONObject("apps").getString("link");
        }
        catch (JSONException e) {
            // empty catch block
        }
        return link;
    }

    public String getKeysLink() {
        String link = null;
        try {
            link = this.data.getJSONObject("keys").getString("link");
        }
        catch (JSONException e) {
            // empty catch block
        }
        return link;
    }

    public JSONObject getJSON() {
        return this.data;
    }

    public String toString() {
        return "AccountInfo{ id=" + this.getId() + " id=" + this.getId() + " username=" + this.getUserName() + " email=" + this.getEmail() + " link=" + this.getLink() + " appsLink=" + this.getAppsLink() + " keysLink=" + this.getKeysLink() + '}';
    }
}