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 lavesGraphQLTypeobjects as they arestatic java.util.Comparator<? super GraphQLSchemaElement>byNameAsc()Returns a comparator that comparesGraphQLTypeobjects 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 ofGraphQLTypeobjects (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 ofGraphQLTypeobjects (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 lavesGraphQLTypeobjects as they are- Returns:
- a comparator that laves
GraphQLTypeobjects as they are
-
byNameAsc
public static java.util.Comparator<? super GraphQLSchemaElement> byNameAsc()
Returns a comparator that comparesGraphQLTypeobjects by ascending name- Returns:
- a comparator that compares
GraphQLTypeobjects by ascending name
-
-