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
As a follow up to this, I found this in the Gson docs.
Type listType = new TypeToken>() {}.getType();
Which solves the problem of getting the type safely but the TypeToken class is specific to Gson.