Class DataFetchingFieldSelectionSetImpl

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String fieldGlobPattern)
      This will return true if the field selection set matches a specified "glob" pattern matching ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).
      boolean containsAllOf​(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
      This will return true if the field selection set matches all of the specified "glob" pattern matches ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).
      boolean containsAnyOf​(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
      This will return true if the field selection set matches any of the specified "glob" pattern matches ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).
      java.util.List<SelectedField> getFields()
      This will return all selected fields.
      java.util.List<SelectedField> getFields​(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
      This will return a list of selected fields that match a specified "glob" pattern matching ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).
      java.util.Map<java.lang.String,​java.util.List<SelectedField>> getFieldsGroupedByResultKey()
      The result key of a selected field represents what the graphql return value will be.
      java.util.Map<java.lang.String,​java.util.List<SelectedField>> getFieldsGroupedByResultKey​(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
      The result key of a selected field represents what the graphql return value will be.
      java.util.List<SelectedField> getImmediateFields()
      This will return all selected fields that are immediate child fields of the field being fetched.
      static DataFetchingFieldSelectionSet newCollector​(GraphQLSchema schema, GraphQLOutputType fieldType, java.util.function.Supplier<ExecutableNormalizedField> normalizedFieldSupplier)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • contains

        public boolean contains​(java.lang.String fieldGlobPattern)
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return true if the field selection set matches a specified "glob" pattern matching ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).

        This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.

        Specified by:
        contains in interface DataFetchingFieldSelectionSet
        Parameters:
        fieldGlobPattern - the glob pattern to match fields against
        Returns:
        true if the selection set contains these fields
        See Also:
        FileSystem.getPathMatcher(String)
      • containsAnyOf

        public boolean containsAnyOf​(java.lang.String fieldGlobPattern,
                                     java.lang.String... fieldGlobPatterns)
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return true if the field selection set matches any of the specified "glob" pattern matches ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).

        This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.

        Specified by:
        containsAnyOf in interface DataFetchingFieldSelectionSet
        Parameters:
        fieldGlobPattern - the glob pattern to match fields against
        fieldGlobPatterns - optionally more glob pattern to match fields against
        Returns:
        true if the selection set contains any of these these fields
        See Also:
        FileSystem.getPathMatcher(String)
      • containsAllOf

        public boolean containsAllOf​(java.lang.String fieldGlobPattern,
                                     java.lang.String... fieldGlobPatterns)
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return true if the field selection set matches all of the specified "glob" pattern matches ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).

        This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.

        Specified by:
        containsAllOf in interface DataFetchingFieldSelectionSet
        Parameters:
        fieldGlobPattern - the glob pattern to match fields against
        fieldGlobPatterns - optionally more glob pattern to match fields against
        Returns:
        true if the selection set contains all of these these fields
        See Also:
        FileSystem.getPathMatcher(String)
      • getFields

        public java.util.List<SelectedField> getFields​(java.lang.String fieldGlobPattern,
                                                       java.lang.String... fieldGlobPatterns)
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return a list of selected fields that match a specified "glob" pattern matching ie the glob pattern matching supported by FileSystem.getPathMatcher(java.lang.String).

        This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.

        The fields are guaranteed to be in pre-order as they appear in the query.

        A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.

        Specified by:
        getFields in interface DataFetchingFieldSelectionSet
        Parameters:
        fieldGlobPattern - the glob pattern to match fields against
        fieldGlobPatterns - optionally more glob pattern to match fields against
        Returns:
        a list of selected fields or empty list if none match
      • getFields

        public java.util.List<SelectedField> getFields()
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return all selected fields.

        The fields are guaranteed to be in pre-order as they appear in the query.

        A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.

        Specified by:
        getFields in interface DataFetchingFieldSelectionSet
        Returns:
        a list of all selected fields or empty list if none match
      • getImmediateFields

        public java.util.List<SelectedField> getImmediateFields()
        Description copied from interface: DataFetchingFieldSelectionSet
        This will return all selected fields that are immediate child fields of the field being fetched.

        The fields are guaranteed to be in pre-order as they appear in the query.

        A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.

        Specified by:
        getImmediateFields in interface DataFetchingFieldSelectionSet
        Returns:
        a list of all selected immediate child fields or empty list if none match
      • getFieldsGroupedByResultKey

        public java.util.Map<java.lang.String,​java.util.List<SelectedField>> getFieldsGroupedByResultKey()
        Description copied from interface: DataFetchingFieldSelectionSet
        The result key of a selected field represents what the graphql return value will be. The same GraphQLFieldDefinition may lead to a field being asked for multiple times (with differing arguments) if field aliases are used. This method helps you get all possible field invocations grouped by their result key. The arguments are guaranteed to be the same if the result key is the same, otherwise the query would not have validated correctly.
        Specified by:
        getFieldsGroupedByResultKey in interface DataFetchingFieldSelectionSet
        Returns:
        a map of selected fields grouped by result key or an empty map if none match
      • getFieldsGroupedByResultKey

        public java.util.Map<java.lang.String,​java.util.List<SelectedField>> getFieldsGroupedByResultKey​(java.lang.String fieldGlobPattern,
                                                                                                               java.lang.String... fieldGlobPatterns)
        Description copied from interface: DataFetchingFieldSelectionSet
        The result key of a selected field represents what the graphql return value will be. The same GraphQLFieldDefinition may lead to a field being asked for multiple times (with differing arguments) if field aliases are used. This method helps you get all possible field invocations grouped by their result key. The arguments are guaranteed to be the same if the result key is the same, otherwise the query would not have validated correctly.
        Specified by:
        getFieldsGroupedByResultKey in interface DataFetchingFieldSelectionSet
        Parameters:
        fieldGlobPattern - the glob pattern to match fields against
        fieldGlobPatterns - optionally more glob pattern to match fields against
        Returns:
        a map of selected fields grouped by result key or an empty map if none match
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object