-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy pathJSON.java
More file actions
38 lines (27 loc) · 946 Bytes
/
JSON.java
File metadata and controls
38 lines (27 loc) · 946 Bytes
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
package apijson.demo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
public class JSON {
public static String toJSONString(Object obj) {
return apijson.JSON.toJSONString(obj);
}
public static JSONObject parseObject(Object obj) {
return apijson.JSON.parseObject(obj);
}
public static JSONArray parseArray(Object obj) {
return apijson.JSON.parseArray(obj);
}
public static JSONObject createJSONObject() {
return apijson.JSON.createJSONObject();
}
public static JSONObject createJSONObject(String key, Object value) {
return apijson.JSON.createJSONObject(key, value);
}
public static JSONObject createJSONObject(Map<String, Object> map) {
return apijson.JSON.createJSONObject(map);
}
public static JSONObject createJSONArray() {
return apijson.JSON.createJSONArray();
}
}