public static boolean hasMethod ( Object obj , String name ) { if ( obj == null ) throw new NullPointerException ( "Object cannot be null" ) ; if ( name == null ) throw new NullPointerException ( "Method name cannot be null" ) ; Class < ? > objClass = obj . getClass ( ) ; for ( Method method : objClass . getMethods ( ) ) { if ( matchMethod ( method , name ) ) return true ; } return false ; }
Checks if object has a method with specified name ..