首页 > 编程知识 正文

json字符串转成list集合,2021-01-01格式

时间:2023-05-05 22:48:08 阅读:47966 作者:4868

list对象从json -----json到list

publicclassserviceexecutionflowpoimplementsserializable {/* *时间*/@ JSON format (pattern=date util.fmt _ datetime,time ) /**动态节点火星画板/专用字符串状态str; /**工作单完成-总结* /私有字符串内容; 公共数据获取时间() { return time; }公共语音设置(日期) { this.time=time; } public String getName (() { return name; }公共语音集名称(字符串名称) { this.name=name; }公共字符串getstatusstr (() { return statusStr; } publicvoidsetstatusstr (stringstatusstr ) { this.statusStr=statusStr; }公共字符串获取内容() { return content; } publicvoidsetcontent (字符串内容) { this.content=content; } @ overridepublicstringtostring ((return ) serviceexecutionflowpo (' ' time=' time ',namepsdmht,statusStrlkdxt, 内容霸气之秋----publicstaticvoidmain (字符串[ ] args (serviceexecutionflowposerviceexecutionflowpo=newserviceeeexexecution ) serviceexecutionflowpo.setcontent (' '; serviceExecutionFlowPO.setName ('工程1 ); serviceexecutionflowpo.settime (new date ); serviceexecutionflowposerviceexecutionflowpo2=newserviceexecutionflowpo (; serviceexecutionflowpo2. set status str ('接收); serviceexecutionflowpo2. setcontent ('; serviceexecutionflowpo2. set name ('工程1 ); serviceexecutionflowpo2. settime (new date ); serviceexecutionflowposerviceexecutionflowpo3=newserviceexecutionflowpo (; serviceexecutionflowpo3. set status str ('完成); serviceexecutionflowpo3. setcontent ('完成总结); serviceexecutionflowpo3. set name ('工程1 ); serviceexecutionflowpo3. settime (new date ); arraylistserviceexecutionflowposerviceexecutionflowpos=new ArrayList (; serviceexecutionflowpos.add (serviceexecutionflowpo; serviceexecutionflowpos.add (serviceexecutionflowpo 2; serviceexecutionflowpos.add (serviceexecutionflowpo 3; stringlistjsonstr=JSON.tojsonstring (serviceexecutionflowpos ); system.out.println(listjsonstr ); arraylistserviceexecutionflowponewlist=new ArrayList (; try { //json是list new list=(arraylistserviceexecutionflowpo ) JSON.parsearray(listjsonstr,serviceexecutionflowpo.clon }catch(exceptione ) { e.printStackTrace ); }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。