List<Map<String,Obiect>>与字符串间的相互转换

public static void main(String[] args) {

    List<Map<String,Object>> list= new ArrayList<>();
    Map<String,Object> map = new HashMap<>();
    map.put("name","推荐");
    map.put("typeId",1);
    map.put("type",1);
    map.put("commodityIds","ids");
    list.add(map);

    Map<String,Object> map1 = new HashMap<>();
    map1.put("name","推荐");
    map1.put("typeId",1);
    map1.put("type",1);
    map1.put("commodityIds","ids");
    list.add(map1);

    String array1 = String.valueOf(JSONArray.fromObject(JSON.toJSONString(list)));

    List<Map<String,Object>> mapList=JSONArray.toList(JSONArray.fromObject(array1),Map.class);

    System.out.println(array1);
    System.out.println(mapList);
}
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FormInfo class FormInfo <<partial>> [ +Formlnfo0- button1 Click(sender:obiect, e:EventArgs) : void+ SetText(run:double, walk:double) : void Form <-- FormInfo Common class Common!+ static) map left lon : double +{static) map top lat : double +{static map right lon : double +{static' map bottom lat : double class Station { +longitute :double <<get>> <<set> >+latitude :double <<get> > <<set>> + staionname :string <<get>> <<set>> + stationlD :int <<get> > <<set>> + address :string <<get>> <<set> > + totalDocks :int <<get> > <<set> > + docksln :int <<get> > < <set> > + status : string <<get> > < <set> > Station-->"screenPoint"Point Form1 class Form1 <<partial>> !-imgH:int- imgW :int isStartSite : bool isEndSite : boolI startIndex :int- endIndex :int - isPlanRoute : bool = false- m distance : double = 0 +Form10 Form1 Shown(sender:obiect,e:EventArgs) : void panelRight SizeChanged(sender:obiect,e:EventArgs): void panelButtom SizeChanged(sender:object, e:EventArgs) : voidForm1 Paint(sender:object, e:PaintEventArgs) : void buttonlmport Click(sender:object, e:EventArgs) : void Import(fileName:string): void GPSToScreen(lon:double.lat:double): PointGetTitude(point:Point): doubel listStations SelectedlndexChanged(sender:obiect, e:EventArgs) : void panel2 Paint(sender:object, e:PaintEventArgs) : voidcheckAll Click(sender:obiect, e:EventArgs) : void comboBox1 SelectedndexChanged(sender:obiect.e:EventAras): voioDrawReqularPoly(x:float, y:float, radius:double, sideCount:int) : PointF panelMouse Paint(sender:obiect,e:PaintEventArgs) : void panelMouse MouseMove(sender:object, e:MouseEventArgs) : voidpanelMouse MouseClick(sender:object, e:MouseEventArgs) : voidbutton1 Click(sender:object, e:EventArgs) : void setRoute0:void - setWalkRoute() : void - comboBox1 TextChanged(sender:object, e:EventArgs) : void class"List1"<T>{ MapHelper class MapHelper!<<const>> EarthRadius : double = 6378.137Istatic' Rad(d:double) : double +Istatic' GetDistance(firstLatitude:double.firstLongitude:double, secondLatitude:doublesecondLongitude:double): double+Istatic1 GetPointDistance(firstPoint:string,secondPoint:string): double Form <-- Form1 Form1-->"allstation<Station>""List1"Form1-->"startPoint"Point Form1-->"endPoint"Point Form1-->"startList<PointFI>""List1" "routeList<PointFIl>""List1Form1-->Form1-->"endList<PointFIl>""List1"Form1-->"m formlnfo"FormInfo画类图
07-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值