0
我有一个附件类型列表[附件是一个类,其中包含一些getters和setter]。但由于某些原因,我需要将此列表转换为字符串,之后,我必须取从字符串列表。将字符串转换为我想要的对象
public class Attachment{
private Integer attachmentCode;
private String attachmentDesc;
}
Attachment attach1 = new Attachment();
Attachment attach2 = new Attachment();
List<Attachment> tempList = new ArrayList<>();
tempList.add(attach1);
tempList.add(attach2);
HibernateClass record = new HibernateClass();
record.setValue(tempList .toString());
如果我想从这个String值中获取Attachment对象,我该如何从这个列表中获得我的值?
你听说过XML或JSON? – SimY4
你说这个字符串在哪里? –
您尚未显示任何希望_parse_的字符串示例。没有一个样本,我们真的帮不了你。 –