
com.fathzer.games.util.ClassUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of games-core Show documentation
Show all versions of games-core Show documentation
A core library to help implement two players games.
The newest version!
package com.fathzer.games.util;
import java.util.List;
/** Some utilities on class.
*/
public interface ClassUtils {
/** Gets the list super classes of a class.
* @param aClass a class
* @return A list of its super classes except Object.class
*/
public static List> getClassHierarchy(Class> aClass) {
final List> result = new java.util.ArrayList<>();
while (aClass != Object.class) {
result.add(aClass);
aClass = aClass.getSuperclass();
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy