gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/lucene/GeodePagination.java
@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;
	}
@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;
	}
@ 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
@param <K> the key class
@param <V> the value class
@param id the unique id
@param pageSize the page size
@param pageKeysRegion the region where pages keys are stors
@param results the collection os results
@return the list of keys in the page region
Store the pagination search result details