Package graphql.schema
Class GraphqlTypeComparators
java.lang.Object
graphql.schema.GraphqlTypeComparators
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator
<? super GraphQLSchemaElement> Returns a comparator that lavesGraphQLType
objects as they arestatic Comparator
<? super GraphQLSchemaElement> Returns a comparator that comparesGraphQLType
objects by ascending namestatic <T extends GraphQLSchemaElement>
List<T> sortTypes
(Comparator<? super GraphQLSchemaElement> comparator, Collection<T> types) This sorts the list ofGraphQLType
objects (by name) and allocates a new sorted list back.
-
Constructor Details
-
GraphqlTypeComparators
public GraphqlTypeComparators()
-
-
Method Details
-
sortTypes
public static <T extends GraphQLSchemaElement> List<T> sortTypes(Comparator<? super GraphQLSchemaElement> comparator, Collection<T> types) This sorts the list ofGraphQLType
objects (by name) and allocates a new sorted list back.- Type Parameters:
T
- the type of type- Parameters:
comparator
- the comparator to usetypes
- the types to sort- Returns:
- a new allocated list of sorted things
-
asIsOrder
Returns a comparator that lavesGraphQLType
objects as they are- Returns:
- a comparator that laves
GraphQLType
objects as they are
-
byNameAsc
Returns a comparator that comparesGraphQLType
objects by ascending name- Returns:
- a comparator that compares
GraphQLType
objects by ascending name
-