<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.75</version>
</dependency>
SysUser sysUser = new SysUser(12L); String ss = JSONObject.toJSONString(sysUser); System.out.println(ss); String aa = "{"admin":false,"params":{"admin":false,"params":{},"userId":4545},"userId":12}"; SysUser sysUser = JSON.parseObject(aa, SysUser.class); System.out.println(sysUser); String s = JSONObject.toJSONString(sysUser); System.out.println(s); ArrayList<String> strings = new ArrayList<>(); strings.add("aa"); strings.add("afd"); strings.add("adsfds"); strings.add("asdfdsa"); LinkedList<String> strings1 = new LinkedList<>(); strings1.add("sdfdsf"); strings1.add("sdfdsf"); strings1.add("sdfdsf"); strings1.add("sdfdfdsfds"); for (String string : strings1) { System.out.println(string); } JSONObject jsonObject = JSONObject.parseObject(aa); System.out.println(jsonObject.getString("userId")); System.out.println(jsonObject.getString("admin")); System.out.println(JSONObject.parseObject(jsonObject.getString("params")).getString("userId"));