Class EncodingCursorStrategy<T>
java.lang.Object
org.springframework.graphql.data.pagination.EncodingCursorStrategy<T>
- Type Parameters:
T
- the type of position
- All Implemented Interfaces:
CursorStrategy<T>
Decorator for a
CursorStrategy
that applies a CursorEncoder
to the cursor String to make it opaque for external use.
To create an instance, use
CursorStrategy.withEncoder(CursorStrategy, CursorEncoder)
.
- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionfromCursor
(String cursor) Parse the given String cursor into a position Object.Return the decoratedCursorStrategy
.Return the configuredCursorEncoder
.boolean
Whether the strategy supports the given type of position Object.Format the given position Object as a String cursor.
-
Method Details
-
getDelegate
Return the decoratedCursorStrategy
. -
getEncoder
Return the configuredCursorEncoder
. -
supports
Description copied from interface:CursorStrategy
Whether the strategy supports the given type of position Object.- Specified by:
supports
in interfaceCursorStrategy<T>
- 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<T>
- 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<T>
- Parameters:
cursor
- the cursor to parse- Returns:
- the position Object
-