Added method for checking lib availability

This commit is contained in:
Ziver Koc 2017-05-16 17:20:49 +02:00
parent 178f881d57
commit c339ba8266

View file

@ -109,6 +109,17 @@ public class ClassUtil {
float.class.isAssignableFrom(type);
}
/**
* @return a bool value depending on if the given class is available in the classpath
*/
public boolean isAvailable(String clazz){
try{
Class.forName(clazz);
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
/**
* @param field is the field to return the generics from