Class QueryDirectivesImpl

  • All Implemented Interfaces:
    QueryDirectives

    public class QueryDirectivesImpl
    extends java.lang.Object
    implements QueryDirectives
    These objects are ALWAYS in the context of a single MergedField

    Also note we compute these values lazily

    • Field Detail

      • variables

        private final java.util.Map<java.lang.String,​java.lang.Object> variables
      • locale

        private final java.util.Locale locale
      • 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()
      • getImmediateDirectivesByName

        public java.util.Map<java.lang.String,​java.util.List<GraphQLDirective>> getImmediateDirectivesByName()
        Description copied from interface: QueryDirectives
        This will return a map of the directives that are immediately on a merged field
        Specified by:
        getImmediateDirectivesByName in interface QueryDirectives
        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: QueryDirectives
        This will return a map of the applied directives that are immediately on a merged field
        Specified by:
        getImmediateAppliedDirectivesByName in interface QueryDirectives
        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: QueryDirectives
        This 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:
        getImmediateDirective in interface QueryDirectives
        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: QueryDirectives
        This 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:
        getImmediateAppliedDirective in interface QueryDirectives
        Parameters:
        directiveName - the named directive
        Returns:
        a list of the named applied directives that are immediately on this merged field