Class ScrollSubrange
java.lang.Object
org.springframework.graphql.data.pagination.Subrange<org.springframework.data.domain.ScrollPosition>
org.springframework.graphql.data.query.ScrollSubrange
Container for parameters that limit result elements to a subrange including a
relative
ScrollPosition
, number of elements, and direction.
For backward pagination, the offset of an OffsetScrollPosition
is adjusted to point to the first item in the range by subtracting the count
from it. Hence, for OffsetScrollPosition
Subrange.forward()
is
always true
.
- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev, Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionScrollSubrange
(org.springframework.data.domain.ScrollPosition pos, Integer count, boolean forward) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScrollSubrange
Create aScrollSubrange
from the given inputs.
-
Constructor Details
-
ScrollSubrange
@Deprecated(since="1.2.4", forRemoval=true) public ScrollSubrange(@Nullable org.springframework.data.domain.ScrollPosition pos, @Nullable Integer count, boolean forward) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofcreate(org.springframework.data.domain.ScrollPosition, java.lang.Integer, boolean)
, to be removed in 1.3.Public constructor.
-
-
Method Details
-
create
public static ScrollSubrange create(@Nullable org.springframework.data.domain.ScrollPosition position, @Nullable Integer count, boolean forward) Create aScrollSubrange
from the given inputs.Pagination with offset-based scrolling is always forward and inclusive of the referenced item. Therefore, an
OffsetScrollPosition
is adjusted as follows. For forward pagination, advanced by 1. For backward pagination, advanced back by the count, and switched to forward.- Parameters:
position
- the reference position, ornull
if not specifiedcount
- how many to return, ornull
if not specifiedforward
- whether scroll forward (true) or backward (false)- Returns:
- the created instance
- Since:
- 1.2.4
-
create(org.springframework.data.domain.ScrollPosition, java.lang.Integer, boolean)
, to be removed in 1.3.