public static boolean isOfSubClassOf ( Object object , Class < ? > clazz ) { if ( object == null || clazz == null ) { return false ; } try { object . getClass ( ) . asSubclass ( clazz ) ; return true ; } catch ( ClassCastException e ) { return false ; } }
Returns whether the given object is an instance of a subclass of the given class that is if it can be cast to the given class .