Given 2 interfaces:
public interface BaseInterface<T> { }
public interface ExtendedInterface<T0, T1> extends BaseInterface<T0> {}
and a concrete class:
public class MyClass implements ExtendedInterface<String, Object> { }
How do I find out the type parameter passed to the BaseInterface interface?
(I can retrieve the ExtendedInterface type parameters by calling something like
MyClass.class.getGenericInterfaces()[0].getActualTypeArguments()
but I can't spot an easy way to recurse into any base generic interfaces and get anything meaningful back).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…