Package graphql.schema
Class DefaultGraphqlTypeComparatorRegistry
- java.lang.Object
-
- graphql.schema.DefaultGraphqlTypeComparatorRegistry
-
- All Implemented Interfaces:
GraphqlTypeComparatorRegistry
@PublicApi public class DefaultGraphqlTypeComparatorRegistry extends java.lang.Object implements GraphqlTypeComparatorRegistry
Associates aComparator
with aGraphqlTypeComparatorEnvironment
to control the scope in which theComparator
can be applied.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultGraphqlTypeComparatorRegistry.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<GraphQLSchemaElement>
DEFAULT_COMPARATOR
-
Fields inherited from interface graphql.schema.GraphqlTypeComparatorRegistry
AS_IS_REGISTRY, BY_NAME_REGISTRY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraphqlTypeComparatorRegistry
defaultComparators()
<T extends GraphQLSchemaElement>
java.util.Comparator<? super T>getComparator(GraphqlTypeComparatorEnvironment environment)
Search for the most to least specific registeredComparator
otherwise a default is returned.static DefaultGraphqlTypeComparatorRegistry.Builder
newComparators()
static java.util.Comparator<GraphQLSchemaElement>
sensibleGroupedOrder()
This orders the schema into a sensible grouped order
-
-
-
Field Detail
-
DEFAULT_COMPARATOR
public static final java.util.Comparator<GraphQLSchemaElement> DEFAULT_COMPARATOR
-
-
Method Detail
-
sensibleGroupedOrder
public static java.util.Comparator<GraphQLSchemaElement> sensibleGroupedOrder()
This orders the schema into a sensible grouped order- Returns:
- a comparator that allows for sensible grouped order
-
getComparator
public <T extends GraphQLSchemaElement> java.util.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
public static GraphqlTypeComparatorRegistry defaultComparators()
- Returns:
- A registry where all
GraphQLType
s receive a defaultComparator
by comparingGraphQLType::getName
.
-
newComparators
public static DefaultGraphqlTypeComparatorRegistry.Builder newComparators()
-
-