Package graphql.schema.idl
Class SchemaParseOrder
- java.lang.Object
-
- graphql.schema.idl.SchemaParseOrder
-
- All Implemented Interfaces:
java.io.Serializable
public class SchemaParseOrder extends java.lang.Object implements java.io.SerializableThis class will track what orderSDLDefinitionwere parsed in viaSchemaParserandTypeDefinitionRegistry- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SchemaParseOrder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends SDLDefinition<?>>
SchemaParseOrderaddDefinition(T sdlDefinition)This adds a newSDLDefinitionto the order<T extends GraphQLSchemaElement>
java.util.Comparator<? super T>getElementComparator()This comparator will sort according to the original parsed orderjava.util.Map<java.lang.String,java.util.List<SDLNamedDefinition<?>>>getInNameOrder()This map is the order in whichSDLDefinitions were parsed per uniqueSourceLocation.getSourceName()and it only containsSDLNamedDefinitions.java.util.Map<java.lang.String,java.util.List<SDLDefinition<?>>>getInOrder()This map is the order in whichSDLDefinitions were parsed per uniqueSourceLocation.getSourceName().<T extends SDLDefinition<?>>
SchemaParseOrderremoveDefinition(T sdlDefinition)This removes aSDLDefinitionfrom the orderjava.lang.StringtoString()
-
-
-
Method Detail
-
getInOrder
public java.util.Map<java.lang.String,java.util.List<SDLDefinition<?>>> getInOrder()
This map is the order in whichSDLDefinitions were parsed per uniqueSourceLocation.getSourceName(). If there is no source then the empty string "" is used.- Returns:
- a map of source names to definitions in parsed order
-
getInNameOrder
public java.util.Map<java.lang.String,java.util.List<SDLNamedDefinition<?>>> getInNameOrder()
This map is the order in whichSDLDefinitions were parsed per uniqueSourceLocation.getSourceName()and it only containsSDLNamedDefinitions. If there is no source then the empty string "" is used.- Returns:
- a map of source names to definitions in parsed order
-
getElementComparator
public <T extends GraphQLSchemaElement> java.util.Comparator<? super T> getElementComparator()
This comparator will sort according to the original parsed order- Type Parameters:
T- is aGraphQLSchemaElement- Returns:
- a comparator that sorts schema elements in parsed order
-
addDefinition
public <T extends SDLDefinition<?>> SchemaParseOrder addDefinition(T sdlDefinition)
This adds a newSDLDefinitionto the order- Type Parameters:
T- for two- Parameters:
sdlDefinition- the SDL definition to add- Returns:
- this
SchemaParseOrderfor fluent building
-
removeDefinition
public <T extends SDLDefinition<?>> SchemaParseOrder removeDefinition(T sdlDefinition)
This removes aSDLDefinitionfrom the order- Type Parameters:
T- for two- Parameters:
sdlDefinition- the SDL definition to remove- Returns:
- this
SchemaParseOrderfor fluent building
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-