Package com.illumon.util.type
Class ClassUtils
java.lang.Object
com.illumon.util.type.ClassUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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
-