public static Map < String , QueryParameter > intersectParametersMap ( List < Report > reports ) { Map < String , QueryParameter > map = new LinkedHashMap < String , QueryParameter > ( ) ; if ( ( reports == null ) || ( reports . size ( ) == 0 ) ) { return map ; } if ( reports . size ( ) == 1 ) { return getUsedParametersMap ( reports . get ( 0 ) , false , false ) ; } Map < String , QueryParameter > firstParamMap = getUsedParametersMap ( reports . get ( 0 ) , false , false ) ; Map < String , QueryParameter > secondParamMap = getUsedParametersMap ( reports . get ( 1 ) , false , false ) ; map = intersectParametersMap ( firstParamMap , secondParamMap ) ; for ( int i = 2 , n = reports . size ( ) ; i < n ; i ++ ) { Map < String , QueryParameter > paramMap = getUsedParametersMap ( reports . get ( i ) , false , false ) ; map = intersectParametersMap ( map , paramMap ) ; if ( map . size ( ) == 0 ) { break ; } } return map ; }
Get a map with all the identical parameters for a list of reports