Class ClassUtils
- java.lang.Object
-
- org.assertj.core.util.introspection.ClassUtils
-
public class ClassUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ClassUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Class<?>>getAllInterfaces(Class<?> cls)Gets aListof all interfaces implemented by the given class and its superclasses.(package private) static voidgetAllInterfaces(Class<?> cls, HashSet<Class<?>> interfacesFound)Get the interfaces for the specified class.static List<Class<?>>getAllSuperclasses(Class<?> cls)Gets aListof superclasses for the given class.
-
-
-
Method Detail
-
getAllSuperclasses
public static List<Class<?>> getAllSuperclasses(Class<?> cls)
Gets a
Listof superclasses for the given class.- Parameters:
cls- the class to look up, may benull- Returns:
- the
Listof superclasses in order going up from this onenullif null input
-
getAllInterfaces
public static List<Class<?>> getAllInterfaces(Class<?> cls)
Gets a
Listof all interfaces implemented by the given class and its superclasses.The order is determined by looking through each interface in turn as declared in the source file and following its hierarchy up. Then each superclass is considered in the same way. Later duplicates are ignored, so the order is maintained.
- Parameters:
cls- the class to look up, may benull- Returns:
- the
Listof interfaces in order,nullif null input
-
-