Say I have a Type a which is a java.util.TreeSet<T>, having been parameterized via a generic we can’t see due to type erasure. We also have a Type b, which is a ‘java.lang.Integer’. How do I construct a ParameterizedType that is a java.util.TreeSet<java.lang.Integer>?
Alternatively, if it’s any easier, we could have a raw java.util.TreeSet type to work with.
Implement
ParameterizedTypelike so:Do more or less the same for
Type.If you need more hints for what
Typeshould actually implement for non-generic types (it’s only a marker interface), look at the JDK source or look at a concrete instance in the debugger.