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_的字符串示例。沒有一個樣本,我們真的幫不了你。 –