Class ScrollPositionCursorStrategy
java.lang.Object
org.springframework.graphql.data.query.ScrollPositionCursorStrategy
- All Implemented Interfaces:
CursorStrategy<org.springframework.data.domain.ScrollPosition>
public final class ScrollPositionCursorStrategy
extends Object
implements CursorStrategy<org.springframework.data.domain.ScrollPosition>
Strategy to convert a
ScrollPosition
to and from a String cursor.- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev, Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionShortcut constructor that usesJsonKeysetCursorStrategy
.ScrollPositionCursorStrategy
(CursorStrategy<Map<String, Object>> keysetCursorStrategy) Constructor with a given strategy to convert akeyset
to and from a cursor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.ScrollPosition
fromCursor
(String cursor) Parse the given String cursor into a position Object.boolean
Whether the strategy supports the given type of position Object.toCursor
(org.springframework.data.domain.ScrollPosition position) Format the given position Object as a String cursor.
-
Constructor Details
-
ScrollPositionCursorStrategy
public ScrollPositionCursorStrategy()Shortcut constructor that usesJsonKeysetCursorStrategy
. -
ScrollPositionCursorStrategy
Constructor with a given strategy to convert akeyset
to and from a cursor.- Parameters:
keysetCursorStrategy
- the keyset cursor strategy
-
-
Method Details
-
supports
Description copied from interface:CursorStrategy
Whether the strategy supports the given type of position Object.- Specified by:
supports
in interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>
- Parameters:
targetType
- the type of position to be checked
-
toCursor
Description copied from interface:CursorStrategy
Format the given position Object as a String cursor.- Specified by:
toCursor
in interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>
- Parameters:
position
- the position to serialize- Returns:
- the created String cursor
-
fromCursor
Description copied from interface:CursorStrategy
Parse the given String cursor into a position Object.- Specified by:
fromCursor
in interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>
- Parameters:
cursor
- the cursor to parse- Returns:
- the position Object
-