Returns all implemented interfaces of the given class.

@param clazz Class to read interfaces from.
@return {@link LinkedHashSet} of interfaces.
@throws ReflectionException If interfaces can't be read.
194590
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);
        }
    }
76848
public static TreeSet<Class<?>> getAllInterfaces(Class<?> cls) {
        final TreeSet<Class<?>> interfacesFound = new TreeSet<>(
            (c1, c2) -> {
                if (c1.equals(c2)) {
                    return 0;
                } else if (c1.isAssignableFrom(c2)) {
                    return 1;
                } else {
                    return -1;
                }
            }
        );
        getAllInterfaces(cls, interfacesFound);
        return interfacesFound;
    }
283223
public static List<Method> getAnnotatedMethods(final Class<?> cls, final Class<? extends Annotation> annotationClass) {
        final List<Method> methodList = new ArrayList<>();

        // Retrieve annotation even when they are wrapped into OnWaves
        for (final Method m : cls.getDeclaredMethods()) {
            if (m.getAnnotationsByType(annotationClass).length > 0) {
                methodList.add(m);
            }
        }

        // Add implemented interfaces methods
        for (final Class<?> i : cls.getInterfaces()) {
            methodList.addAll(getAnnotatedMethods(i, annotationClass));
        }

        // Add super class methods
        if (cls.getSuperclass() != null) {
            methodList.addAll(getAnnotatedMethods(cls.getSuperclass(), annotationClass));
        }

        return methodList;
    }
910311
public static Set<Class<?>> getAllSuperTypes(final Class<?> cls) {
        final Set<Class<?>> superTypesFound = new LinkedHashSet<>();

        getAllSuperTypes(cls, superTypesFound);

        return superTypesFound;
    }
1174168
public static Method[] getAllMethods(Class<?> clazz) {
        Method[] allMethods = allClassMethodsCache.get(clazz);
        if (allMethods == null) {
            // Allows a race between concurrent threads coming for clazz's methods at the same time,
            // but the race seems to be harmless.
            allMethods = doGetAllMethods(clazz);
            allClassMethodsCache.put(clazz, allMethods);
        }
        return allMethods;
    }
240244
public static List<Method> getAllMethod(Class<?> clazz) {
        return ALL_METHOD_CACHE.compute(clazz, (key, value) -> {
            if (value == null) {
                List<Method> methods = new ArrayList<>();
                Map<String, Method> methodMap = getAllMethod(key, new HashMap<>());

                methodMap.forEach((k, v) -> methods.add(v));
                return methods;
            } else {
                return value;
            }
        });
    }
485175
private static List<Method> getAnnotatedMethods(Class<?> clazz){
		List<Method> methods = new ArrayList<Method>();
		
		for(Method method:getAllMethods(clazz))
			if(!isNull(method.getAnnotation(JMapConversion.class)))
				methods.add(method);
		
		return methods;
	}
1066507
public static <T extends Annotation> Set<Field> getAnnotatedFields(Class<? extends Object> clazz,
			Class<T> annotation) {
		if (Object.class.equals(clazz)) {
			return Collections.emptySet();
		}
		Set<Field> annotatedFields = new HashSet<Field>();
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			if (field.getAnnotation(annotation) != null) {
				annotatedFields.add(field);
			}
		}
		annotatedFields.addAll(getAnnotatedFields(clazz.getSuperclass(), annotation));
		return annotatedFields;
	}
672433
public static Map<Method, Method> findManagedMethods(Class<?> clazz)
    {
        Map<Method, Method> result = new HashMap<>();

        // gather all publicly available methods
        // this returns everything, even if it's declared in a parent
        for (Method method : clazz.getMethods()) {
            // skip methods that are used internally by the vm for implementing covariance, etc
            if (method.isSynthetic() || method.isBridge()) {
                continue;
            }

            // look for annotations recursively in superclasses or interfaces
            Method managedMethod = findManagedMethod(clazz, method.getName(), method.getParameterTypes());
            if (managedMethod != null) {
                result.put(method, managedMethod);
            }
        }

        return result;
    }
905465
public static Method getMethod(Class clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null) {
            return null;
        }
        try {
            return clazz.getDeclaredMethod(methodName, parameterTypes);
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return null;
    }
44552
protected List<Field> getFields(Class<?> clazz) {
        List<Field> fields = new ArrayList<Field>();

        while (clazz != null && !isBoundaryClass(clazz)) {
            for (Field field : clazz.getDeclaredFields()) {
                if (!field.isAnnotationPresent(Inject.class)) {
                    continue;
                }
                fields.add(field);
            }
            clazz = clazz.getSuperclass();
        }
        return fields;
    }
132837
public static Method[] getAllInstanceMethods(final Class<?> clazz) {
        if (clazz == null) {
            return null;
        }

        List<Method> methods = new ArrayList<Method>();
        for (Method method : clazz.getMethods()) {
            if (!Modifier.isStatic(method.getModifiers())
                    && Modifier.isPublic(method.getModifiers())) {
                methods.add(method);
            }
        }

        return methods.toArray(new Method[methods.size()]);
    }
501527
public static Field[] getAllFields(Class<?> clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("You must specify the class that contains the fields");
        }
        Set<Field> fields = new LinkedHashSet<Field>();

        Class<?> thisType = clazz;

        while (thisType != null) {
            final Field[] declaredFields = thisType.getDeclaredFields();
            for (Field field : declaredFields) {
                field.setAccessible(true);
                fields.add(field);
            }
            thisType = thisType.getSuperclass();
        }
        return fields.toArray(new Field[fields.size()]);
    }
583325
static List<Field> getAllFieldsOfClass0(Class<?> clazz) {
        List<Field> fields = CollectionUtil.createArrayList();
        for (Class<?> itr = clazz; hasSuperClass(itr); ) {
            fields.addAll(Arrays.asList(itr.getDeclaredFields()));
            itr = itr.getSuperclass();
        }

        return fields;
    }
243379
public static Method[] getAllMethod(Class<?> clazz) {
        if (clazz == null) {
            return null;
        }
        try {
            return clazz.getDeclaredMethods();
        } catch (SecurityException e) {
            e.printStackTrace();
        }
        return null;
    }
281887
private Set<String> getClasses(String name, ClassLoader cl)
   {
      Set<String> result = new HashSet<String>();
      
      try
      {
         Class<?> clz = Class.forName(name, true, cl);
         while (!Object.class.equals(clz))
         {
            result.add(clz.getName());
            clz = clz.getSuperclass();
         }
      }
      catch (Throwable t)
      {
         log.debugf("Couldn't load: %s", name);
      }

      return result;
   }
1108226
@SuppressWarnings("unchecked")
    public <T> List<T> getList(Class<T> clazz) {
        return (List<T>) objects;
    }