public static < OutT , InT > PagedList < OutT > toPagedList ( List < InT > list , final Func1 < InT , OutT > mapper ) { PageImpl < InT > page = new PageImpl <> ( ) ; page . setItems ( list ) ; page . setNextPageLink ( null ) ; PagedList < InT > pagedList = new PagedList < InT > ( page ) { @ Override public Page < InT > nextPage ( String nextPageLink ) { return null ; } } ; PagedListConverter < InT , OutT > converter = new PagedListConverter < InT , OutT > ( ) { @ Override public Observable < OutT > typeConvertAsync ( InT inner ) { return Observable . just ( mapper . call ( inner ) ) ; } } ; return converter . convert ( pagedList ) ; }
Converts the given list of a type to paged list of a different type .