Package graphql.execution.directives
Class QueryDirectivesImpl
- java.lang.Object
-
- graphql.execution.directives.QueryDirectivesImpl
-
- All Implemented Interfaces:
QueryDirectives
public class QueryDirectivesImpl extends java.lang.Object implements QueryDirectives
These objects are ALWAYS in the context of a single MergedFieldAlso note we compute these values lazily
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface graphql.execution.directives.QueryDirectives
QueryDirectives.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private LockKit.ComputedOncecomputedOnceprivate DirectivesResolverdirectivesResolverprivate com.google.common.collect.ImmutableMap<Field,java.util.List<QueryAppliedDirective>>fieldAppliedDirectivesByFieldprivate com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<QueryAppliedDirective>>fieldAppliedDirectivesByNameprivate com.google.common.collect.ImmutableMap<Field,java.util.List<GraphQLDirective>>fieldDirectivesByFieldprivate com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<GraphQLDirective>>fieldDirectivesByNameprivate GraphQLContextgraphQLContextprivate java.util.Localelocaleprivate MergedFieldmergedFieldprivate GraphQLSchemaschemaprivate java.util.Map<java.lang.String,java.lang.Object>variables
-
Constructor Summary
Constructors Constructor Description QueryDirectivesImpl(MergedField mergedField, GraphQLSchema schema, java.util.Map<java.lang.String,java.lang.Object> variables, GraphQLContext graphQLContext, java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcomputeValuesLazily()java.util.List<QueryAppliedDirective>getImmediateAppliedDirective(java.lang.String directiveName)This will return a list of the named applied directives that are immediately on this merged field.java.util.Map<Field,java.util.List<QueryAppliedDirective>>getImmediateAppliedDirectivesByField()This will return a map of theFields inside aMergedFieldand the immediate applied directives that are on each specific fieldjava.util.Map<java.lang.String,java.util.List<QueryAppliedDirective>>getImmediateAppliedDirectivesByName()This will return a map of the applied directives that are immediately on a merged fieldjava.util.List<GraphQLDirective>getImmediateDirective(java.lang.String directiveName)This will return a list of the named directives that are immediately on this merged field.java.util.Map<Field,java.util.List<GraphQLDirective>>getImmediateDirectivesByField()This will return a map of theFields inside aMergedFieldand the immediate directives that are on each specific fieldjava.util.Map<java.lang.String,java.util.List<GraphQLDirective>>getImmediateDirectivesByName()This will return a map of the directives that are immediately on a merged fieldprivate QueryAppliedDirectiveArgumenttoAppliedArgument(GraphQLArgument argument)private QueryAppliedDirectivetoAppliedDirective(GraphQLDirective directive)
-
-
-
Field Detail
-
directivesResolver
private final DirectivesResolver directivesResolver
-
mergedField
private final MergedField mergedField
-
schema
private final GraphQLSchema schema
-
variables
private final java.util.Map<java.lang.String,java.lang.Object> variables
-
graphQLContext
private final GraphQLContext graphQLContext
-
locale
private final java.util.Locale locale
-
computedOnce
private final LockKit.ComputedOnce computedOnce
-
fieldDirectivesByField
private volatile com.google.common.collect.ImmutableMap<Field,java.util.List<GraphQLDirective>> fieldDirectivesByField
-
fieldDirectivesByName
private volatile com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<GraphQLDirective>> fieldDirectivesByName
-
fieldAppliedDirectivesByField
private volatile com.google.common.collect.ImmutableMap<Field,java.util.List<QueryAppliedDirective>> fieldAppliedDirectivesByField
-
fieldAppliedDirectivesByName
private volatile com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<QueryAppliedDirective>> fieldAppliedDirectivesByName
-
-
Constructor Detail
-
QueryDirectivesImpl
public QueryDirectivesImpl(MergedField mergedField, GraphQLSchema schema, java.util.Map<java.lang.String,java.lang.Object> variables, GraphQLContext graphQLContext, java.util.Locale locale)
-
-
Method Detail
-
computeValuesLazily
private void computeValuesLazily()
-
toAppliedDirective
private QueryAppliedDirective toAppliedDirective(GraphQLDirective directive)
-
toAppliedArgument
private QueryAppliedDirectiveArgument toAppliedArgument(GraphQLArgument argument)
-
getImmediateDirectivesByField
public java.util.Map<Field,java.util.List<GraphQLDirective>> getImmediateDirectivesByField()
Description copied from interface:QueryDirectivesThis will return a map of theFields inside aMergedFieldand the immediate directives that are on each specific field- Specified by:
getImmediateDirectivesByFieldin interfaceQueryDirectives- Returns:
- a map of all directives on each field inside this
-
getImmediateAppliedDirectivesByField
public java.util.Map<Field,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByField()
Description copied from interface:QueryDirectivesThis will return a map of theFields inside aMergedFieldand the immediate applied directives that are on each specific field- Specified by:
getImmediateAppliedDirectivesByFieldin interfaceQueryDirectives- Returns:
- a map of all directives on each field inside this
-
getImmediateDirectivesByName
public java.util.Map<java.lang.String,java.util.List<GraphQLDirective>> getImmediateDirectivesByName()
Description copied from interface:QueryDirectivesThis will return a map of the directives that are immediately on a merged field- Specified by:
getImmediateDirectivesByNamein interfaceQueryDirectives- Returns:
- a map of all the directives immediately on this merged field
-
getImmediateAppliedDirectivesByName
public java.util.Map<java.lang.String,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByName()
Description copied from interface:QueryDirectivesThis will return a map of the applied directives that are immediately on a merged field- Specified by:
getImmediateAppliedDirectivesByNamein interfaceQueryDirectives- Returns:
- a map of all the applied directives immediately on this merged field
-
getImmediateDirective
public java.util.List<GraphQLDirective> getImmediateDirective(java.lang.String directiveName)
Description copied from interface:QueryDirectivesThis will return a list of the named directives that are immediately on this merged field. Read above for why this is a list of directives and not just one- Specified by:
getImmediateDirectivein interfaceQueryDirectives- Parameters:
directiveName- the named directive- Returns:
- a list of the named directives that are immediately on this merged field
-
getImmediateAppliedDirective
public java.util.List<QueryAppliedDirective> getImmediateAppliedDirective(java.lang.String directiveName)
Description copied from interface:QueryDirectivesThis will return a list of the named applied directives that are immediately on this merged field. Read above for why this is a list of applied directives and not just one- Specified by:
getImmediateAppliedDirectivein interfaceQueryDirectives- Parameters:
directiveName- the named directive- Returns:
- a list of the named applied directives that are immediately on this merged field
-
-