public static LinkedHashSet < Class < ? > > getInterfaces ( Class < ? > clazz ) throws ReflectionException { Validate . notNull ( clazz ) ; try { LinkedHashSet < Class < ? > > interfaces = new LinkedHashSet <> ( ) ; interfaces . addAll ( Arrays . asList ( clazz . getInterfaces ( ) ) ) ; LinkedHashSet < Class < ? > > superclasses = getSuperclasses ( clazz ) ; for ( Class < ? > superclass : superclasses ) { interfaces . addAll ( Arrays . asList ( superclass . getInterfaces ( ) ) ) ; } return interfaces ; } catch ( Exception e ) { throw new ReflectionException ( e ) ; } }
Returns all implemented interfaces of the given class .