public FacetedPageImpl(List<T> content, Pageable pageable, long total) { super(content, ofNullable(pageable).orElse(Pageable.unpaged()), total); }
public <T> Page<T> continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class<T> clazz) { SearchScrollRequest request = new SearchScrollRequest(scrollId); request.scroll(TimeValue.timeValueMillis(scrollTimeInMillis)); SearchResponse response; try { response = client.searchScroll(request); } catch (IOException e) { throw new ElasticsearchException("Error for search request with scroll: " + request.toString(), e); } return resultsMapper.mapResults(response, clazz, Pageable.unpaged()); }
public <T> Page<T> continueScroll(@Nullable String scrollId, long scrollTimeInMillis, Class<T> clazz, SearchResultMapper mapper) { SearchScrollRequest request = new SearchScrollRequest(scrollId); request.scroll(TimeValue.timeValueMillis(scrollTimeInMillis)); SearchResponse response; try { response = client.searchScroll(request); } catch (IOException e) { throw new ElasticsearchException("Error for search request with scroll: " + request.toString(), e); } return mapper.mapResults(response, clazz, Pageable.unpaged()); }
/** * @param criteria */ public SimpleQuery(Criteria criteria) { this(criteria, Pageable.unpaged()); }
/** * Creates a new {@link SliceImpl} with the given content. This will result in the created {@link Slice} being * identical to the entire {@link List}. * * @param content must not be {@literal null}. */ public SliceImpl(List<T> content) { this(content, Pageable.unpaged(), false); }
public DeserializeablePage(final List<T> content) { this(content, Pageable.unpaged(), null == content ? 0 : content.size()); }
/** * Creates a new {@link PageImpl} with the given content. This will result in the created {@link Page} being identical * to the entire {@link List}. * * @param content must not be {@literal null}. */ public PageImpl(List<T> content) { this(content, Pageable.unpaged(), null == content ? 0 : content.size()); }
public DeserializeablePage(final List<T> content) { this(content, Pageable.unpaged(), null == content ? 0 : content.size()); }
public UnpagedPageImpl(@NonNull List<T> content, long total) { Assert.notNull(content, "content must not be null!"); this.pageable = Pageable.unpaged(); this.content = content; this.total = total; }
DefaultSelectSpecSupport(String table) { Assert.hasText(table, "Table name must not be null!"); this.table = table; this.projectedFields = Collections.emptyList(); this.sort = Sort.unsorted(); this.page = Pageable.unpaged(); }
@Override public Pageable getPageRequest() { if (this.rows == null && this.offset == null) { return Pageable.unpaged(); } int rows = this.rows != null ? this.rows : DEFAULT_PAGE_SIZE; long offset = this.offset != null ? this.offset : 0; return new SolrPageRequest(rows != 0 ? (int) (offset / rows) : 0, rows, this.sort); }
DefaultSelectSpecSupport(String table) { Assert.hasText(table, "Table name must not be null!"); this.table = table; this.projectedFields = Collections.emptyList(); this.sort = Sort.unsorted(); this.page = Pageable.unpaged(); }
/** * Creates a new empty {@link Page}. * * @return * @since 2.0 */ static <T> Page<T> empty() { return empty(Pageable.unpaged()); }
public Pageable previousPageable() { return hasPrevious() ? pageable.previousOrFirst() : Pageable.unpaged(); }
public <T> Page<T> mapResults(SearchScrollResult response, Class<T> clazz) { LinkedList<T> results = new LinkedList<>(); for (SearchScrollResult.Hit<JsonObject, Void> hit : response.getHits(JsonObject.class)) { if (hit != null) { results.add(mapSource(hit.source, clazz)); } } return new AggregatedPageImpl<>(results, Pageable.unpaged(), response.getTotal(), response.getScrollId()); }
public Pageable getPageable() { return delegate.getPageable().isPaged() ? new CountPageable(delegate.getPageable()) : Pageable.unpaged(); }
@Override public Page<T> findAll(Pageable pageable) { Assert.notNull(pageable, "Pageable must not be null!"); if (pageable.isUnpaged()) { List<T> result = findAll(); return new PageImpl<>(result, Pageable.unpaged(), result.size()); } Iterable<T> content = operations.findInRange(pageable.getOffset(), pageable.getPageSize(), pageable.getSort(), entityInformation.getJavaType()); return new PageImpl<>(IterableConverter.toList(content), pageable, this.operations.count(entityInformation.getJavaType())); }
@Override public Page<T> findAll(Pageable pageable) { Assert.notNull(pageable, "Pageable must not be null!"); if (pageable.isUnpaged()) { List<T> result = findAll(); return new PageImpl<>(result, Pageable.unpaged(), result.size()); } Iterable<T> content = operations.findInRange(pageable.getOffset(), pageable.getPageSize(), pageable.getSort(), entityInformation.getJavaType()); return new PageImpl<>(IterableConverter.toList(content), pageable, this.operations.count(entityInformation.getJavaType())); }
@Override public Page<T> findAll(Pageable pageable) { Assert.notNull(pageable, "Pageable must not be null!"); if (pageable.isUnpaged()) { List<T> result = findAll(); return new PageImpl<>(result, Pageable.unpaged(), result.size()); } Iterable<T> content = operations.findInRange(pageable.getOffset(), pageable.getPageSize(), pageable.getSort(), entityInformation.getJavaType()); return new PageImpl<>(IterableConverter.toList(content), pageable, this.operations.count(entityInformation.getJavaType())); }