@ Contract ( pure = true ) private static boolean isCallback ( @ NonNull final Method method , @ NonNull final Class < ? > resultClass , @ NonNull final String methodName ) { if ( method . getName ( ) . equals ( methodName ) ) { if ( method . getReturnType ( ) == Void . TYPE ) { final Class < ? > [ ] parameters = method . getParameterTypes ( ) ; if ( parameters . length == 1 && parameters [ 0 ] . isAssignableFrom ( resultClass ) ) { return true ; } } } return false ; }
Checks if a method can be used as a callback to handle operation result .