java json字符串转JSONObject对象、转JAVA对象、转List<T>对象

转JsonObject:

Object region = JSONObject.parse(regions.toString());

转对象:

BStationRegion stationRegion = JSONObject.parseObject(regions.toString(),BStationRegion.class);

转list对象集合:

List<BStationRegion> stationRegionList = JSONObject.parseArray(regions.toString(),BStationRegion.class);

参考:https://blog.csdn.net/zhu_nana/article/details/91868249

 

posted @ 2021-09-08 10:09  super超人  阅读(1708)  评论(0)    收藏  举报