This post explores different ways to get the Type information of a List<T> object during runtime and convert a JSON array to a Java List using the Gson library.

5m read timeFrom feeds.feedblitz.com
Post cover image
Table of contents
1. Overview2. Problem Description3. Solution Using getParameterized() in TypeToken4. Solution Using JsonArray5. Solution Using TypeToken From Guava6. Solution Using ParameterizedType of Java Reflection API7. Conclusion

Sort: