@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public < K , V > List < String > storePaginationMap ( String id , int pageSize , Region < String , Collection < K > > pageKeysRegion , List < Map . Entry < K , V > > results ) { if ( results == null || results . isEmpty ( ) ) return null ; //add to pages List < Collection < K > > pagesCollection = toKeyPages ( ( List ) results , pageSize ) ; int pageIndex = 1 ; String key = null ; ArrayList < String > keys = new ArrayList < String > ( pageSize ) ; for ( Collection < K > page : pagesCollection ) { //store in region key = toPageKey ( id , pageIndex ++ ) ; pageKeysRegion . put ( key , page ) ; keys . add ( key ) ; } keys . trimToSize ( ) ; return keys ; }
Store the pagination search result details