Package graphql.schema
Class DefaultGraphqlTypeComparatorRegistry
java.lang.Object
graphql.schema.DefaultGraphqlTypeComparatorRegistry
- All Implemented Interfaces:
GraphqlTypeComparatorRegistry
@PublicApi
public class DefaultGraphqlTypeComparatorRegistry
extends Object
implements GraphqlTypeComparatorRegistry
Associates a
Comparator
with a GraphqlTypeComparatorEnvironment
to control the scope in which the Comparator
can be applied.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface graphql.schema.GraphqlTypeComparatorRegistry
AS_IS_REGISTRY, BY_NAME_REGISTRY
-
Method Summary
Modifier and TypeMethodDescription<T extends GraphQLSchemaElement>
Comparator<? super T> getComparator
(GraphqlTypeComparatorEnvironment environment) Search for the most to least specific registeredComparator
otherwise a default is returned.static Comparator
<GraphQLSchemaElement> This orders the schema into a sensible grouped order
-
Field Details
-
DEFAULT_COMPARATOR
-
-
Method Details
-
sensibleGroupedOrder
This orders the schema into a sensible grouped order- Returns:
- a comparator that allows for sensible grouped order
-
getComparator
public <T extends GraphQLSchemaElement> Comparator<? super T> getComparator(GraphqlTypeComparatorEnvironment environment) Search for the most to least specific registeredComparator
otherwise a default is returned.- Specified by:
getComparator
in interfaceGraphqlTypeComparatorRegistry
- Type Parameters:
T
- the type of the comparator- Parameters:
environment
- Defines the scope to control where theComparator
can be applied.- Returns:
- The registered
Comparator
ornull
if not found.
-
defaultComparators
- Returns:
- A registry where all
GraphQLType
s receive a defaultComparator
by comparingGraphQLType::getName
.
-
newComparators
-