I need to get the class reference for several templates classes for use with guice. For a normal type I can do String.class but List<String>.class, is a syntax error.
How can I get the class object for a templated 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.
You don’t, which is why you use
TypeLiteral:You can use that in the bindings in the same way as classes.