我试图从服务器(JSON)获取一个RealmList的RealmList到realm对象中。我收到以下错误消息:
"error: RealmList的元素类型必须是实现'RealmModel'接口的类之一,或者是以下类型之一:'java.lang.String'、'byte[]'、'java.lang.Boolean'、'java.lang.Long'、'java.lang.Integer'、'java.lang.Short'、'java.lang.Byte'、'java.lang.Double'、'java.lang.Float'或者是 'java.util.Date'。"
"error: RealmList的元素类型必须是实现'RealmModel'接口的类之一,或者是以下类型之一:'java.lang.String'、'byte[]'、'java.lang.Boolean'、'java.lang.Long'、'java.lang.Integer'、'java.lang.Short'、'java.lang.Byte'、'java.lang.Double'、'java.lang.Float'或者是 'java.util.Date'。"
{
"facilities": [
{
"facility_id": "1",
"name": "Property Type",
"options": [
{
"name": "Apartment",
"icon": "apartment",
"id": "1"
},
{
"name": "Condo",
"icon": "condo",
"id": "2"
},
{
"name": "Boat House",
"icon": "boat",
"id": "3"
},
{
"name": "Land",
"icon": "land",
"id": "4"
}
]
},
{
"facility_id": "2",
"name": "Number of Rooms",
"options": [
{
"name": "1 to 3 Rooms",
"icon": "rooms",
"id": "6"
},
{
"name": "No Rooms",
"icon": "no-room",
"id": "7"
}
]
},
{
"facility_id": "3",
"name": "Other facilities",
"options": [
{
"name": "Swimming Pool",
"icon": "swimming",
"id": "10"
},
{
"name": "Garden Area",
"icon": "garden",
"id": "11"
},
{
"name": "Garage",
"icon": "garage",
"id": "12"
}
]
}
],
"exclusions": [
[
{
"facility_id": "1",
"options_id": "4"
},
{
"facility_id": "2",
"options_id": "6"
}
],
[
{
"facility_id": "1",
"options_id": "3"
},
{
"facility_id": "3",
"options_id": "12"
}
],
[
{
"facility_id": "2",
"options_id": "7"
},
{
"facility_id": "3",
"options_id": "12"
}
]
]
}