so I have this class in Java:
public class Foo{
}
and inside this class I want to know if T implements certain interface.
The
Use isAssignableFrom()
isAssignableFrom() determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter.
if (SomeInterface.class.isAssignableFrom(T class)) {
//do stuff
}