package cn.autoform.bean; import java.util.ArrayList; import java.util.List; import cn.autoform.util.tool.JSONTool; import cn.autoform.util.tool.ObjectUtil; import lombok.Data; @Data public class ProcessCon { private List retired; public void setRetired(String a){ if(ObjectUtil.empty(a)){ this.retired = new ArrayList<>(); }else{ this.retired = JSONTool.toList(JSONTool.toJson(a.split(",")),String.class); } } public static void main(String[] args) { ProcessCon a = new ProcessCon(); a.setRetired("[1]:10,[2]:20"); a.getRetired().add("[3]:20"); String c = a.getRetired().toString(); String b = c.substring(1, c.length()-1); System.out.println(b); } public String getLog(){ String s = this.getRetired().toString(); return s.substring(1, s.length()-1); } }