private IQueryResult < T > filteredResult ( IQueryResult < T > unfilteredResult ) { List < T > unfilteredList = unfilteredResult . getResults ( ) ; List < T > filteredList = unfilteredList == null ? null : filters . filter ( unfilteredList ) ; Map < String , Object > metadata = Collections . < String , Object > singletonMap ( "unfiltered" , unfilteredResult ) ; return QueryUtil . packageResult ( filteredList , unfilteredResult . getStatus ( ) , metadata ) ; }
Repackages the query result as the filtered result with the unfiltered version stored in the metadata under the unfiltered key .