Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get all (derived) interfaces of a class

Apache Commons Lang has method you need: ClassUtils.getAllInterfaces


Guava Solution:

final Set<TypeToken> tt = TypeToken.of(cls).getTypes().interfaces();

This is a much more powerful and cleaner reflection API than the ancient Apache stuff.


Don't forget, Spring Framework has many similar util classes like Apache Commons Lang. So there is: org.springframework.util.ClassUtils#getAllInterfaces