mardi 3 janvier 2017

How to declare a map with class as key and an Array of java.lang.reflect.Constructor as value

I'm building a map for caching purposes that contains a class as the key and the constructors of the class (Array) as the value.

How do I declare this map using generics?

private static Map<Class<T>, java.lang.reflect.Constructor<T>[]> classConstructorsCache = new HashMap<>();

Above statements gives a "T cannot be resolved to a type" error.





Aucun commentaire:

Enregistrer un commentaire