Class Subrange<P>
java.lang.Object
org.springframework.graphql.data.pagination.Subrange<P>
- Type Parameters:
- P- the type of position in the entire collection
- Direct Known Subclasses:
- ScrollSubrange
Container for parameters that limit result elements to a subrange including a
 relative position, number of elements, and direction.
- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncount()The number of elements in the subrange based on the "first" and "last" arguments from the GraphQL Cursor connection spec.booleanforward()Whether the subrange is forward or backward from ths position, depending on whether the argument sent "first" or "last".position()The position of the result element the subrange is relative to.
- 
Constructor Details- 
SubrangeConstructor with the relative position, count, and direction.- Parameters:
- position- the position in the entire collection
- count- the number of elements in the subrange
- forward- whether the subrange is forward or backward from ths position
 
 
- 
- 
Method Details- 
positionThe position of the result element the subrange is relative to. This is decoded from the "before" or "after" input arguments from the GraphQL Cursor connection spec viaCursorStrategy.
- 
countThe number of elements in the subrange based on the "first" and "last" arguments from the GraphQL Cursor connection spec.
- 
forwardpublic boolean forward()Whether the subrange is forward or backward from ths position, depending on whether the argument sent "first" or "last".Note: The direction may not always match the original value. For backward pagination, for example, an offset cursor could be adjusted down by the count of elements, switching backward to forward. 
 
-