Java Class Load getClassHierarchyLeaf( Collection> classes)

Here you can find the source of getClassHierarchyLeaf( Collection> classes)

Description

get Class Hierarchy Leaf

License

Apache License

Declaration

public static Class<?> getClassHierarchyLeaf(
        Collection<Class<?>> classes) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {

    public static Class<?> getClassHierarchyLeaf(
            Collection<Class<?>> classes) {
        Class<?> hierarchyLeaf = null;
        for (Class<?> clazz : classes) {
            if (hierarchyLeaf == null) {
                hierarchyLeaf = clazz;//from ww w .j  a va 2  s . c  o m
            } else if (clazz != null) {
                if (hierarchyLeaf.isAssignableFrom(clazz)) {
                    hierarchyLeaf = clazz;
                }
            }

        }
        return hierarchyLeaf;
    }
}

Related

  1. getClassesOfType(T[] l, Class type)
  2. getClassesTree(Class clazz)
  3. getClassForDomain(String domain)
  4. getClassFQNString(Class clazz, StringBuilder sb)
  5. getClassHierarchyFrom(Class clazz)
  6. getClassName(String logicalName, String trailingName)
  7. getClassNameRepresentation(String name)
  8. getClassNames( StackTraceElement[] currentStack)
  9. loadClass(Class context, String... names)