Package org.springframework.data.domain
Class OffsetScrollPosition
java.lang.Object
org.springframework.data.domain.OffsetScrollPosition
- All Implemented Interfaces:
ScrollPosition
A
ScrollPosition
based on the offsets within query results.- Since:
- 3.1
- Author:
- Mark Paluch, Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.domain.ScrollPosition
ScrollPosition.Direction
-
Method Summary
Modifier and TypeMethodDescriptionadvanceBy
(long delta) Returns a newOffsetScrollPosition
that has been advanced by the given value.boolean
long
The zero or positive offset.int
hashCode()
boolean
Returns whether the current scroll position is the initial one.static IntFunction<OffsetScrollPosition>
positionFunction
(long startOffset) Returns theposition function
to calculate.toString()
-
Method Details
-
positionFunction
Returns theposition function
to calculate.- Parameters:
startOffset
- the start offset to be used. Must not be negative.- Returns:
- the offset-based position function.
-
getOffset
public long getOffset()The zero or positive offset.- Returns:
- the offset.
-
advanceBy
Returns a newOffsetScrollPosition
that has been advanced by the given value. Negative deltas will be constrained so that the new offset is at least zero.- Parameters:
delta
- the value to advance the current offset by.- Returns:
- will never be null.
-
isInitial
public boolean isInitial()Description copied from interface:ScrollPosition
Returns whether the current scroll position is the initial one.- Specified by:
isInitial
in interfaceScrollPosition
- Returns:
-
equals
-
hashCode
public int hashCode() -
toString
-