Package graphql.language
Interface DirectivesContainer<T extends DirectivesContainer>
-
- All Superinterfaces:
Node<T>
,java.io.Serializable
- All Known Subinterfaces:
ImplementingTypeDefinition<T>
,TypeDefinition<T>
- All Known Implementing Classes:
EnumTypeDefinition
,EnumTypeExtensionDefinition
,EnumValueDefinition
,Field
,FieldDefinition
,FragmentDefinition
,FragmentSpread
,InlineFragment
,InputObjectTypeDefinition
,InputObjectTypeExtensionDefinition
,InputValueDefinition
,InterfaceTypeDefinition
,InterfaceTypeExtensionDefinition
,ObjectTypeDefinition
,ObjectTypeExtensionDefinition
,OperationDefinition
,ScalarTypeDefinition
,ScalarTypeExtensionDefinition
,SchemaDefinition
,SchemaExtensionDefinition
,UnionTypeDefinition
,UnionTypeExtensionDefinition
,VariableDefinition
@PublicApi public interface DirectivesContainer<T extends DirectivesContainer> extends Node<T>
Represents a language node that can contain Directives. Directives can be repeatable and (by default) non repeatable.There are access methods here that get the two different types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<Directive>
getDirectives()
This will return a list of all the directives that have been put onNode
as a flat list, which may contain repeatable and non repeatable directives.default java.util.List<Directive>
getDirectives(java.lang.String directiveName)
Returns all of the directives with the provided name, including repeatable and non repeatable directives.default java.util.Map<java.lang.String,java.util.List<Directive>>
getDirectivesByName()
This will return a Map of the all directives that are associated with aNode
, including both repeatable and non repeatable directives.default boolean
hasDirective(java.lang.String directiveName)
This returns true if the AST node contains one or more directives by the specified name-
Methods inherited from interface graphql.language.Node
accept, deepCopy, getAdditionalData, getChildren, getComments, getIgnoredChars, getNamedChildren, getSourceLocation, isEqualTo, withNewChildren
-
-
-
-
Method Detail
-
getDirectives
java.util.List<Directive> getDirectives()
This will return a list of all the directives that have been put onNode
as a flat list, which may contain repeatable and non repeatable directives.- Returns:
- a list of all the directives associated with this Node
-
getDirectivesByName
default java.util.Map<java.lang.String,java.util.List<Directive>> getDirectivesByName()
This will return a Map of the all directives that are associated with aNode
, including both repeatable and non repeatable directives.- Returns:
- a map of all directives by directive name
-
getDirectives
default java.util.List<Directive> getDirectives(java.lang.String directiveName)
Returns all of the directives with the provided name, including repeatable and non repeatable directives.- Parameters:
directiveName
- the name of the directives to retrieve- Returns:
- the directives or empty list if there is not one with that name
-
hasDirective
default boolean hasDirective(java.lang.String directiveName)
This returns true if the AST node contains one or more directives by the specified name- Parameters:
directiveName
- the name ot check- Returns:
- true if the AST node contains one or more directives by the specified name
-
-