{"height":"190","blog_url":"https://gfx.hatenablog.com/","categories":[],"type":"rich","author_name":"gfx","title":"Gson.fromJson()\u3067List<T>\u3092\u8fd4\u3059\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u3069\u3046\u3084\u3063\u3066\u5b9a\u7fa9\u3059\u308b\u304b","description":"google/gson Gson\u3067List<T>\u3092\u30c7\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3059\u308b\u306e\u304c\u3051\u3063\u3053\u3046\u9762\u5012\u304f\u3055\u304f\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093*1\u3002 Type collectionType = new TypeToken<Collection<Integer>>(){}.getType(); List<Integer> ints2 = gson.fromJson(json, collectionType); \u3068\u3053\u308d\u304c\u3001 List<T> \u3092\u610f\u5473\u3059\u308b Type \u578b\u3092 Class<List<T>> \u3068 Class<T> \u304b\u3089\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308c\u3070\u30cf\u30c3\u30af\u304c\u4e0d\u8981\u306b\u306a\u308b\u306f\u305a\uff01\u3068\u304a\u3082\u3063\u3066\u63a2\u3057\u305f\u3068\u3053\u308d\u3001\u304b\u306a\u308a\u30de\u30b8\u30ab\u30eb\u306a\u65b9\u6cd5\u306a\u304c\u3089\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgfx.hatenablog.com%2Fentry%2F2015%2F08%2F28%2F132304\" title=\"Gson.fromJson()\u3067List&lt;T&gt;\u3092\u8fd4\u3059\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u3069\u3046\u3084\u3063\u3066\u5b9a\u7fa9\u3059\u308b\u304b - Islands in the byte stream\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"author_url":"https://blog.hatena.ne.jp/gfx/","published":"2015-08-28 13:23:04","blog_title":"Islands in the byte stream","width":"100%","version":"1.0","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","url":"https://gfx.hatenablog.com/entry/2015/08/28/132304"}