so I have this class in Java:
public class Foo{ }
and inside this class I want to know if T implements certain interface.
The
you can check it using isAssignableFrom
if (YourInterface.class.isAssignableFrom(clazz)) { ... }
or to get the array of interface as
Class[] intfs = clazz.getInterfaces();