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 newOffsetScrollPositionthat has been advanced by the given value.booleanlongThe zero or positive offset.inthashCode()booleanReturns whether the current scroll position is the initial one.static IntFunction<OffsetScrollPosition>positionFunction(long startOffset) Returns theposition functionto calculate.toString()
-
Method Details
-
positionFunction
Returns theposition functionto 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 newOffsetScrollPositionthat 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:ScrollPositionReturns whether the current scroll position is the initial one.- Specified by:
isInitialin interfaceScrollPosition- Returns:
-
equals
-
hashCode
public int hashCode() -
toString
-