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.Serializable
This class will track what orderSDLDefinition
were parsed in viaSchemaParser
andTypeDefinitionRegistry
- 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 newSDLDefinition
to 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 whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
and it only containsSDLNamedDefinition
s.java.util.Map<java.lang.String,java.util.List<SDLDefinition<?>>>
getInOrder()
This map is the order in whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
.<T extends SDLDefinition<?>>
SchemaParseOrderremoveDefinition(T sdlDefinition)
This removes aSDLDefinition
from the orderjava.lang.String
toString()
-
-
-
Method Detail
-
getInOrder
public java.util.Map<java.lang.String,java.util.List<SDLDefinition<?>>> getInOrder()
This map is the order in whichSDLDefinition
s 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 whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
and it only containsSDLNamedDefinition
s. 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 newSDLDefinition
to the order- Type Parameters:
T
- for two- Parameters:
sdlDefinition
- the SDL definition to add- Returns:
- this
SchemaParseOrder
for fluent building
-
removeDefinition
public <T extends SDLDefinition<?>> SchemaParseOrder removeDefinition(T sdlDefinition)
This removes aSDLDefinition
from the order- Type Parameters:
T
- for two- Parameters:
sdlDefinition
- the SDL definition to remove- Returns:
- this
SchemaParseOrder
for fluent building
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-