Determine if a Class implements a interface in Java

Solution 1:

You should use isAssignableFrom:

if (YourInterface.class.isAssignableFrom(clazz)) {
    ...
}

Solution 2:

you can use the below function to get all the implemented interfaces

Class[] intfs = clazz.getInterfaces();