public static boolean safeIsAssignableFrom ( Object obj , String className ) { try { Class < ? > clazz = Class . forName ( className ) ; return clazz . isAssignableFrom ( obj . getClass ( ) ) ; } catch ( ClassNotFoundException ignored ) { return false ; } }
Checks whether an object is an instance of given type without throwing exception when the class is not loaded .