1 Star 0 Fork 17

xiaohaozi / Flink_Code

forked from Appleyuchi / Flink_Code 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
JsonString_User.java 744 Bytes
一键复制 编辑 原始数据 按行查看 历史
fastsource 提交于 2021-01-20 21:10 . 整理
import com.alibaba.fastjson.JSON;
import java.io.FileNotFoundException;
import java.io.IOException;
public class JsonString_User {
public static void main(String[] args) throws FileNotFoundException, IOException {
//---------------------------json字符串 -> User------------------------
/*
* 字符串:{"name":"userGroup","users":[{"password":"123123"
* ,"username":"zhangsan"},{"password":"321321","username":"lisi"}]}
*/
String jsonStr3 = "{'name':'userGroup','users':[{'password':'123123','username':'zhangsan'},{'password':'321321','username':'lisi'}]}";
UserGroup userGroup = JSON.parseObject(jsonStr3, UserGroup.class);
System.out.println("json字符串转复杂java对象:" + userGroup);
}
}
1
https://gitee.com/haozilovecat/Flink_Code.git
git@gitee.com:haozilovecat/Flink_Code.git
haozilovecat
Flink_Code
Flink_Code
master

搜索帮助