jeudi 19 juillet 2018

Actual type of generic interface method parameter

This question has been answered when an implementing class is involved (which I don't have), but those methods are not working for me.

Let's say I have an an interface

public interface MySuperInterface<T> {
    public void test(T arg);
}

And then an extending interface

public interface MyInterface extends MySuperInterface<String>
{
}

Is it possible to get the actual class that will be used in the method 'test' via reflection from the MyInterface class?





Aucun commentaire:

Enregistrer un commentaire