java 类型之间互相转换
1.String 转 JSONObject
JSONObject resBean = JSONObject.parseObject(json.getString("resourceinfobean"));
2.Object 转 JSONObject
JSONObject json = (JSONObject) JSONObject.toJSON(obj);
3.JSONObject 转 对象
JSONObject resBean = JSONObject.parseObject(json.getString("resourceinfobean"));
ResourceInfoBean bean = JSONUtil.toBean(resBean.toJSONString(), ResourceInfoBean.class);
4.逗号分割String类型转list
String str ="1,2,3";
List<String> split= Arrays.asList(str.split(","));
5.逗号分割String类型转Long类型的list
String str ="1,2,3";
Arrays.stream(str .split(",")).map(Long::valueOf).collect(Collectors.toList());