ArrayList Type
1
2
3
|
Gson gson = new Gson();
Type type = new TypeToken<List<YourClass>>(){}.getType();
List<YourClass> arryList = gson.fromJson(JsonDataString, type);
| cs |
Map Type
1
2
3
|
Gson gson = new Gson();
Type type = new TypeToken<Map<Object, Object>>(){}.getType();
Map<Object, Object> mapObject = gson.fromJson(JsonDataString, type);
|
댓글 없음:
댓글 쓰기