How does one do something like:
Schema<ArrayList<UnitInstanceData>> scheme =
RuntimeSchema.getSchema(ArrayList<UnitInstanceData>.class));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
.classis runtime access to the class object. At runtime generics are gone, having been eliminated by “type erasure”. In your example, all you can get isArrayList.class. If you need to know the type of the generic class at runtime you must pass a second parameter, as in