private static Map<String, Method> getLifecycleMethodByMethodName(Set<String> methodNames, boolean isBefore) {
        Map<String, Method> lifecycleMethodByName = new HashMap<String, Method>();
        for (Method method : JdbcLifecycleEventListener.class.getMethods()) {
            lifecycleMethodByName.put(method.getName(), method);
        }

        Map<String, Method> result = new HashMap<String, Method>();
        for (String methodName : methodNames) {
            String lifecycleMethodName = (isBefore ? "before" : "after") + capitalize(methodName);
            Method targetLifecycleMethod = lifecycleMethodByName.get(lifecycleMethodName);
            result.put(methodName, targetLifecycleMethod);
        }
        return result;
    }
private static Map < String , Method > getLifecycleMethodByMethodName ( Set < String > methodNames , boolean isBefore ) { Map < String , Method > lifecycleMethodByName = new HashMap < String , Method > ( ) ; for ( Method method : JdbcLifecycleEventListener . class . getMethods ( ) ) { lifecycleMethodByName . put ( method . getName ( ) , method ) ; } Map < String , Method > result = new HashMap < String , Method > ( ) ; for ( String methodName : methodNames ) { String lifecycleMethodName = ( isBefore ? "before" : "after" ) + capitalize ( methodName ) ; Method targetLifecycleMethod = lifecycleMethodByName . get ( lifecycleMethodName ) ; result . put ( methodName , targetLifecycleMethod ) ; } return result ; }
Retrieve corresponding lifecycle methods declared in {@link JdbcLifecycleEventListener}.

<p>Format is {@code [before|after]<MethodName>}

@param methodNames set of method names to find
@param isBefore    whether to retrieve before methods or after methods
@return a map that key is the method name string and value is lifecycle method