Class ClassUtils

java.lang.Object
com.illumon.util.type.ClassUtils

public class ClassUtils
extends Object
  • Constructor Details

  • 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 retrieve
      expectedType - the type of class we expect className to be
      Returns:
      the Class object for className