If I have a class with a constructor that takes a parameterized generic type:
public class Foo {
public Foo(Map<String, Object> data) {
...
}
}
... how can I refer to this parameterized Map class if I want to call:
Constructor constructor = cls.getConstructor()
(Where clsis the Foo class.)
I want to do something like:
Constructor constructor = cls.getConstructor(Map<String,Object>.class);
... but it does not work.
I am sure there is a simple answer to this question!
source
share