I wrote this generic method, but I don't know how to programmatically tell the List
the kind of objects it must contain.
I read that I can't know the <T>
object class, so I added another parameter (returnClass) to the method.
public <T extends IModel> List<T> getIModel(Cursor cursor, Class<T> returnClass){
//returnClass is the class that List must contains.
//I need something like this
List<returnClass.getClass()> list;
}
Aucun commentaire:
Enregistrer un commentaire