/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }
/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }
/** * Creates an instance of a class with the given fully qualified class name. * * @param <T> The generic object type. * @param className fully qualified class name of the class for which an instance needs to be created * @return an instance of the class denoted by className * @throws IllegalStateException if the class cannot be found */ @SuppressWarnings("unchecked") public static <T> T instance(String className) { return (T) instance(toClass(className)); }