我從我們的客戶以下JSON:GSON模型,而關鍵
{
"id": 1234,
"delivery_date": 1234567890,
"actions": [
[ "foo", true],
[ "bar", true]
],
"customer": {
"id": 12345,
"company": "",
"firstname": "John",
"lastname": "Smith",
"action": ["dothis", true]
},
"childs": [ 123abc2132312312,11232432943493]
}
我想分析的「動作」數組列表<操作>的ActionList和單一的「行動」爲行動行動。
隨着
class Action {
String action;
boolean yesno;
}
而且孩子的數組作爲列表<兒童>與
class Child{
String id
}
童車這是可能的,而不JSON鑰匙?
是否設置了結構?我沒有看到在動作中有兩個元素數組的背後的任何原因 – dzsonni 2014-10-20 13:53:58
您可以使'List'爲'Action'的參數。它應該相應地填充。如果你想保持它們獨立,那麼從GSON創建另一個類,然後分割它。 –
Doomsknight
2014-10-20 13:56:18
是的結構設置。我已經要求將json更改爲鍵值對 - 沒有成功:( – Fabian 2014-10-20 13:56:41