public PagedList < V > convert ( final PagedList < U > uList ) { if ( uList == null || uList . isEmpty ( ) ) { return new PagedList < V > ( ) { @ Override public Page < V > nextPage ( String s ) throws RestException , IOException { return null ; } } ; } Page < U > uPage = uList . currentPage ( ) ; final PageImpl < V > vPage = new PageImpl <> ( ) ; vPage . setNextPageLink ( uPage . nextPageLink ( ) ) ; vPage . setItems ( new ArrayList < V > ( ) ) ; loadConvertedList ( uPage , vPage ) ; return new PagedList < V > ( vPage ) { @ Override public Page < V > nextPage ( String nextPageLink ) throws RestException , IOException { Page < U > uPage = uList . nextPage ( nextPageLink ) ; final PageImpl < V > vPage = new PageImpl <> ( ) ; vPage . setNextPageLink ( uPage . nextPageLink ( ) ) ; vPage . setItems ( new ArrayList < V > ( ) ) ; loadConvertedList ( uPage , vPage ) ; return vPage ; } } ; }
Converts the paged list .