All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.openapitools.swagger.ClassUtils Maven / Gradle / Ivy

The newest version!
package io.openapitools.swagger;

final class ClassUtils {

    private ClassUtils() {
    }

    public static Class loadClass(String className, ClassLoader classLoader) {
        try {
            return Class.forName(className, true, classLoader);
        } catch (ClassNotFoundException e) {
            return null;
        }
    }

    public static  T createInstance(Class clazz) {
        try {
            return clazz.getDeclaredConstructor().newInstance();
        } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
            return null;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy