AccountInfo.java
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* 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() + '}';
}
}