@ Override public String [ ] searchRoles ( String search ) throws RolesException { // Complete list of users String [ ] roles = role_list . keySet ( ) . toArray ( new String [ role_list . size ( ) ] ) ; List < String > found = new ArrayList < String > ( ) ; // Look through the list for anyone who matches for ( int i = 0 ; i < roles . length ; i ++ ) { if ( roles [ i ] . toLowerCase ( ) . contains ( search . toLowerCase ( ) ) ) { found . add ( roles [ i ] ) ; } } // Return the list return found . toArray ( new String [ found . size ( ) ] ) ; }
Returns a list of roles matching the search .