Class JsonKeysetCursorStrategy
java.lang.Object
org.springframework.graphql.data.query.JsonKeysetCursorStrategy
- All Implemented Interfaces:
CursorStrategy<Map<String,
Object>>
public final class JsonKeysetCursorStrategy
extends Object
implements CursorStrategy<Map<String,Object>>
Strategy to convert a
keyset
to and
from a JSON String for use with ScrollPositionCursorStrategy
.- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionShortcut constructor that usesServerCodecConfigurer
.JsonKeysetCursorStrategy
(CodecConfigurer codecConfigurer) Constructor with aCodecConfigurer
in which to find the JSON encoder and decoder to use. -
Method Summary
Modifier and TypeMethodDescriptionfromCursor
(String cursor) Parse the given String cursor into a position Object.boolean
Whether the strategy supports the given type of position Object.Format the given position Object as a String cursor.
-
Constructor Details
-
JsonKeysetCursorStrategy
public JsonKeysetCursorStrategy()Shortcut constructor that usesServerCodecConfigurer
. -
JsonKeysetCursorStrategy
Constructor with aCodecConfigurer
in which to find the JSON encoder and decoder to use.- Parameters:
codecConfigurer
- the codec configurer to be checked for JSON codec
-
-
Method Details
-
supports
Description copied from interface:CursorStrategy
Whether the strategy supports the given type of position Object.- Specified by:
supports
in interfaceCursorStrategy<Map<String,
Object>> - 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<Map<String,
Object>> - Parameters:
keys
- 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<Map<String,
Object>> - Parameters:
cursor
- the cursor to parse- Returns:
- the position Object
-