I have a method for reading JSON from a service, I\'m using Gson to do my serialization and have written the following method using type parameters.
public T
You can use Bozho's solution, or avoid the creation of a temporary array list by using:
Class> clazz = (Class) List.class;
The only problem with this solution is that you have to suppress the unchecked warning with @SuppressWarnings("unchecked").
@SuppressWarnings("unchecked")