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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Sortextract(DataFetchingEnvironment environment) Return aSortinstance by extracting the sort information from GraphQL arguments, orSort.unsorted()otherwise.protected abstract org.springframework.data.domain.Sort.DirectiongetDirection(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:SortStrategyReturn aSortinstance by extracting the sort information from GraphQL arguments, orSort.unsorted()otherwise.- Specified by:
extractin interfaceSortStrategy- Parameters:
environment- the data fetching environment
-
getProperties
Return the sort properties to use, or an empty list if there are none.- Parameters:
environment- the data fetching environment for this operation
-
getDirection
@Nullable protected abstract org.springframework.data.domain.Sort.Direction getDirection(DataFetchingEnvironment environment) Return the sort direction to use, ornull.- Parameters:
environment- the data fetching environment for this operation
-