I'm attempting to convert the following method:
public List<AliasIp> getStoreAsList(String storeName) {
return new java.util.ArrayList<>(Arrays.asList(mGson.fromJson(getStoreRaw(storeName), AliasIp[].class)));
}
To a generic version similar to:
public <T> List<T> getStoreAsList(String storeName) {
return new java.util.ArrayList<T>(Arrays.asList(mGson.fromJson(getStoreRaw(storeName), T[].class)));
}
But I'm running into troubles with the T[].class which doesn't compile with the error:
"Cannot select from a type variable"
What should the syntax be to avoid that error?