Package com.illumon.util.type
Class ClassUtils
java.lang.Object
com.illumon.util.type.ClassUtils
public class ClassUtils extends Object
-
Constructor Summary
Constructors Constructor Description ClassUtils()
-
Method Summary
Modifier and Type Method Description static <T> Class<? extends T>
checkedClassForName(String className, Class<T> expectedType)
Gets the specified className, and if it is assignable from the expectedType returns it.
-
Constructor Details
-
ClassUtils
public ClassUtils()
-
-
Method Details
-
checkedClassForName
@NotNull public static <T> Class<? extends T> checkedClassForName(String className, Class<T> expectedType)Gets the specified className, and if it is assignable from the expectedType returns it. Otherwise throws a RuntimeException.- Type Parameters:
T
- expectedType- Parameters:
className
- the class we would like to retrieveexpectedType
- the type of class we expect className to be- Returns:
- the Class object for className
-