net.dreamlu.utils.BeanUtil Maven / Gradle / Ivy
package net.dreamlu.utils;
/**
* 实体工具类
* @author L.cm
* email: [email protected]
* site:http://www.dreamlu.net
* date 2015年4月26日下午5:10:42
*/
public class BeanUtil {
/**
* 实例化对象
* @param clazz 类
* @param type parameter
* @return 对象
*/
@SuppressWarnings("unchecked")
public static T newInstance(Class> clazz) {
try {
return (T) clazz.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy