2016-08-16 26 views
-1

我只是想知道是否有任何可能性在Model類上創建列表或ArrayList。ModelList上的ArrayList

根據以下數據,您可以看到ConditionList在Model類上傳遞。

{ 
    "Id": 30, 
    "FirstName": "Lilly", 
    "LastName": "Fowler", 
    "KnownName": "Lills", 
    "GenderId": 14, 
    "DateOfBirth": "2009-03-18T00:00:00", 
    "**ConditionList**": [{ 
     "Child_ConditionId": 11, 
     "Name": "Bee Sting Allergy", 
     "Treatment": "phone me and softly put the bee sting cream on it and smooth it down.The cream will be in her bag", 
     "DoctorName": null, 
     "DoctorContact": null, 
     "MedicationDescription": null 
    }], 
    "CreatedOn": "2015-05-30T19:44:13.2", 
    "UpdatedOn": "2015-06-04T19:29:01.303", 
    "ProfileImage": "http://mobile.aimy.co.nz:80/Media/mum_cropped_4fe98f04-f772-4ac0-ba51-d99fbd119e4b.jpeg" 
}] 

回答

0
@SerializeName("**ConditionList**") private List<ConditionList> conditionList; 

既然你不能在Java變量使用這些符號,你應當使用插話與Gson

+0

獲得埃羅上序列化的名字應該作爲字符串傳遞。但是,任何離開謝謝。 @SerializeName(「** ConditionList **」)private List conditionList; –