be.bagofwords.util.ReflectionUtils Maven / Gradle / Ivy
package be.bagofwords.util;
public class ReflectionUtils {
public static T createObject(Class _class) {
try {
return _class.getConstructor().newInstance();
} catch (Exception e) {
throw new RuntimeException("Failed to create object from class " + _class + ". Does this class have an empty constructor?", e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy