static boolean isInstanceOfType ( Object instance , Class < ? > clazz ) { if ( clazz . isInterface ( ) ) { throw new UnsupportedOperationException ( "Under GWT, we can't determine whether an object is an instance of an interface Class" ) ; } for ( Class < ? > current = instance . getClass ( ) ; current != null ; current = current . getSuperclass ( ) ) { if ( current . equals ( clazz ) ) { return true ; } } return false ; }
Returns true if the instance is assignable to the type Clazz .