Class AbstractSortStrategy
java.lang.Object
org.springframework.graphql.data.query.AbstractSortStrategy
- All Implemented Interfaces:
SortStrategy
Convenient base class for a
SortStrategy
. Subclasses help to extract
the list of sort properties
and direction
.- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Sort
extract
(DataFetchingEnvironment environment) Return aSort
instance by extracting the sort information from GraphQL arguments, orSort.unsorted()
otherwise.protected abstract org.springframework.data.domain.Sort.Direction
getDirection
(DataFetchingEnvironment environment) Return the sort direction to use, ornull
.getProperties
(DataFetchingEnvironment environment) Return the sort properties to use, or an empty list if there are none.
-
Constructor Details
-
AbstractSortStrategy
public AbstractSortStrategy()
-
-
Method Details
-
extract
Description copied from interface:SortStrategy
Return aSort
instance by extracting the sort information from GraphQL arguments, orSort.unsorted()
otherwise.- Specified by:
extract
in interfaceSortStrategy
-
getProperties
Return the sort properties to use, or an empty list if there are none. -
getDirection
@Nullable protected abstract org.springframework.data.domain.Sort.Direction getDirection(DataFetchingEnvironment environment) Return the sort direction to use, ornull
.
-