Package graphql.schema
Class GraphqlTypeComparators
- java.lang.Object
-
- graphql.schema.GraphqlTypeComparators
-
public class GraphqlTypeComparators extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GraphqlTypeComparators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Comparator<? super GraphQLSchemaElement>
asIsOrder()
Returns a comparator that lavesGraphQLType
objects as they arestatic java.util.Comparator<? super GraphQLSchemaElement>
byNameAsc()
Returns a comparator that comparesGraphQLType
objects by ascending namestatic <T extends GraphQLSchemaElement>
java.util.List<T>sortTypes(java.util.Comparator<? super GraphQLSchemaElement> comparator, java.util.Collection<T> types)
This sorts the list ofGraphQLType
objects (by name) and allocates a new sorted list back.
-
-
-
Method Detail
-
sortTypes
public static <T extends GraphQLSchemaElement> java.util.List<T> sortTypes(java.util.Comparator<? super GraphQLSchemaElement> comparator, java.util.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
public static java.util.Comparator<? super GraphQLSchemaElement> asIsOrder()
Returns a comparator that lavesGraphQLType
objects as they are- Returns:
- a comparator that laves
GraphQLType
objects as they are
-
byNameAsc
public static java.util.Comparator<? super GraphQLSchemaElement> byNameAsc()
Returns a comparator that comparesGraphQLType
objects by ascending name- Returns:
- a comparator that compares
GraphQLType
objects by ascending name
-
-