/** * Get a set of dimension row(s) given a set of ApiFilters. * * @param filters ApiFilters to use for finding matching dimension rows * * @return set of dimension row(s) * */ default TreeSet<DimensionRow> findFilteredDimensionRows(Set<ApiFilter> filters) { return new TreeSet<>( findFilteredDimensionRowsPaged(filters, PaginationParameters.EVERYTHING_IN_ONE_PAGE).getPageOfData() ); }
/** * Getter for dimension rows. * * @return Set of dimension rows the Search Provider has in it's indexes * */ default Set<DimensionRow> findAllDimensionRows() { return new LinkedHashSet<>( findAllDimensionRowsPaged(PaginationParameters.EVERYTHING_IN_ONE_PAGE).getPageOfData() ); }
/** * Add links to the response builder and return a stream with the requested page from the raw data. * * @param <T> The type of the collection elements * @param pagination The pagination object * @param responseBuilder The builder for the http response * @param uriInfo The context object desribing the requested uri * * @return A stream from the subcollection of the data collection corresponding to the page described */ public static <T> Stream<T> paginate( Response.ResponseBuilder responseBuilder, Pagination<T> pagination, UriInfo uriInfo ) { Arrays.stream(PaginationLink.values()) .forEachOrdered(link -> addPageLink(responseBuilder, link, uriInfo, pagination)); return pagination.getPageOfData().stream(); } }
/** * Cuts the result set down to just the page requested. * * @param resultSet The result set to be cut down. * * @return The page of results desired. */ @Override public ResultSet map(ResultSet resultSet) { Pagination<Result> pages = new AllPagesPagination<>(resultSet, paginationParameters); AbstractResponse.addLinks(pages, uriBuilder, responseProcessor); //uses map for additional flexibility and robustness, even though it is currently a no-op. return new ResultSet(map(resultSet.getSchema()), pages.getPageOfData()); }