public static Map . Entry < String , String > match ( Map < String , String > categoriesByPackage , String pkg ) { if ( categoriesByPackage != null && pkg != null ) { for ( Map . Entry < String , String > e : categoriesByPackage . entrySet ( ) ) { if ( Minimatch . minimatch ( pkg . replaceAll ( "\\." , "/" ) , e . getKey ( ) . replaceAll ( "\\." , "/" ) ) ) { return e ; } } } return null ; }
Check if there is a pattern in the map that match the given package