private static ArrayList < NamedList < Object > > rewriteToArray ( NamedList < Object > nnl ) { ArrayList < NamedList < Object >> al = new ArrayList <> ( ) ; String key ; Iterator < Entry < String , Object > > it = nnl . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < String , Object > entry = it . next ( ) ; NamedList < Object > item = ( NamedList < Object > ) entry . getValue ( ) ; key = entry . getKey ( ) ; if ( key . startsWith ( GroupHit . KEY_START ) ) { StringBuilder newKey = new StringBuilder ( "" ) ; item . add ( "group" , GroupHit . keyToObject ( key , newKey ) ) ; item . add ( "key" , newKey . toString ( ) . trim ( ) ) ; } else { item . add ( "key" , key ) ; } al . add ( item ) ; } return al ; }
Rewrite to array .