惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
博客园_首页
MyScale Blog
MyScale Blog
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
F
Full Disclosure
V
V2EX
博客园 - Franky
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
SecWiki News
SecWiki News
N
Netflix TechBlog - Medium
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Martin Fowler
Martin Fowler
PCI Perspectives
PCI Perspectives
S
Security @ Cisco Blogs
Recorded Future
Recorded Future
Help Net Security
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
AI
AI
Microsoft Azure Blog
Microsoft Azure Blog
K
Kaspersky official blog
G
GRAHAM CLULEY
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
CERT Recently Published Vulnerability Notes
U
Unit 42
T
Tor Project blog
Cloudbric
Cloudbric
Hacker News - Newest:
Hacker News - Newest: "LLM"
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
Security Latest
Security Latest
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

MakeItClear

Fish Shell 设置 python3 为默认版本 Homebrew 安装及更新软件 | MakeItClear Mac 安装配置Mysql | MakeItClear Mac 安装配置 Miniconda | MakeItClear Hyper & Fish Shell | MakeItClear Mac 终端提示: The default interactive shell is now zsh. Chrome 内置二维码功能 | MakeItClear Chrome 优秀插件推荐「持续更新」 | MakeItClear Mac 免费效率软件推荐「持续更新」 | MakeItClear
FastJson 对象、JSON、字符串、Map 之间的互转 | MakeItClear
2021-03-02 · via MakeItClear
  1. 对象与字符串之间的互转
// 将对象转换成为字符串
String str = JSON.toJSONString(infoDo);
// 字符串转换成为对象
InfoDo infoDo = JSON.parseObject(strInfoDo, InfoDo.class);
  1. 对象集合与字符串之间的互转
// 将对象集合转换成为字符串
String users = JSON.toJSONString(users);
// 将字符串转换成为对象集合
List<User> userList = JSON.parseArray(userStr, User.class); 
  1. 字符串互转JSONObject
// String 转 Json对象
JSONObject jsonObject = JSONObject.parseObject(jsonString);
// json对象转string
JSONObject jsonObject = JSONObject.parseObject(str);//json对象转字符串 
String jsonString = jsonObject.toJSONString();
  1. map与字符串之间互转
//字符串转map
JSONObject  jsonObject = JSONObject.parseObject(str);
Map<String,Object> map = (Map<String,Object>)jsonObject;//    //json对象转Map
//map转字符串
String jsonString = JSON.toJSONString(map);
  1. Map 转 Json对象
//map转json对象    
Map<String,Object> map = new HashMap<>();
map.put("age", 24);
map.put("name", "cool_summer_moon");
JSONObject json = new JSONObject(map);  
//json对象转Map   
Map<String,Object> map = (Map<String,Object>)jsonObject;