Class SliceConnectionAdapter
java.lang.Object
org.springframework.graphql.data.pagination.ConnectionAdapterSupport<org.springframework.data.domain.ScrollPosition>
org.springframework.graphql.data.query.SliceConnectionAdapter
- All Implemented Interfaces:
ConnectionAdapter
public final class SliceConnectionAdapter
extends ConnectionAdapterSupport<org.springframework.data.domain.ScrollPosition>
implements ConnectionAdapter
Adapter for
Slice
to Connection
.- Since:
- 1.2
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionSliceConnectionAdapter
(CursorStrategy<org.springframework.data.domain.ScrollPosition> strategy) Constructor with theCursorStrategy
to use to encode theScrollPosition
of page items. -
Method Summary
Modifier and TypeMethodDescriptionReturn a cursor for the item at the given index.<T> Collection<T>
getContent
(Object container) Return the contained items as a List.boolean
Whether there are more pages after this one.boolean
hasPrevious
(Object container) Whether there are more pages before this one.boolean
Whether the adapter supports the given Object container type.Methods inherited from class org.springframework.graphql.data.pagination.ConnectionAdapterSupport
getCursorStrategy
-
Constructor Details
-
SliceConnectionAdapter
public SliceConnectionAdapter(CursorStrategy<org.springframework.data.domain.ScrollPosition> strategy) Constructor with theCursorStrategy
to use to encode theScrollPosition
of page items.
-
-
Method Details
-
supports
Description copied from interface:ConnectionAdapter
Whether the adapter supports the given Object container type.- Specified by:
supports
in interfaceConnectionAdapter
-
getContent
Description copied from interface:ConnectionAdapter
Return the contained items as a List.- Specified by:
getContent
in interfaceConnectionAdapter
-
hasPrevious
Description copied from interface:ConnectionAdapter
Whether there are more pages before this one.- Specified by:
hasPrevious
in interfaceConnectionAdapter
-
hasNext
Description copied from interface:ConnectionAdapter
Whether there are more pages after this one.- Specified by:
hasNext
in interfaceConnectionAdapter
-
cursorAt
Description copied from interface:ConnectionAdapter
Return a cursor for the item at the given index.- Specified by:
cursorAt
in interfaceConnectionAdapter
-