Class EmptyEntityGraphImpl

  • All Implemented Interfaces:
    EntityGraph

    final class EmptyEntityGraphImpl
    extends java.lang.Object
    implements EntityGraph
    EntityGraph implementation that does not contain any fields/subgraphs. Methods that are supposed to modify the graph would throw an UnsupportedOperationException.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> clazz  
    • Constructor Summary

      Constructors 
      Constructor Description
      EmptyEntityGraphImpl​(java.lang.Class<?> clazz)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EntityGraph addField​(java.lang.String fieldName)
      Add a field into this graph for all existing entity-filtering scopes.
      EntityGraph addField​(java.lang.String fieldName, java.lang.String... filteringScopes)
      Add a field into this graph for given list of entity-filtering scopes.
      EntityGraph addField​(java.lang.String fieldName, java.util.Set<java.lang.String> filteringScopes)
      Add a field into this graph for given set of entity-filtering scopes.
      EntityGraph addFilteringScopes​(java.util.Set<java.lang.String> filteringScopes)
      Add a set of entity-filtering scopes to this graph.
      EntityGraph addSubgraph​(java.lang.String fieldName, java.lang.Class<?> fieldClass)
      Add a subgraph into this graph for all existing entity-filtering scopes.
      EntityGraph addSubgraph​(java.lang.String fieldName, java.lang.Class<?> fieldClass, java.lang.String... filteringScopes)
      Add a subgraph into this graph for given list of entity-filtering scopes.
      EntityGraph addSubgraph​(java.lang.String fieldName, java.lang.Class<?> fieldClass, java.util.Set<java.lang.String> filteringScopes)
      Add a subgraph into this graph for given set of entity-filtering scopes.
      boolean equals​(java.lang.Object o)  
      java.util.Set<java.lang.String> getClassFilteringScopes()
      Get all available entity-filtering scopes defined on a class.
      java.lang.Class<?> getEntityClass()
      Get an entity class this graph is created for.
      java.util.Set<java.lang.String> getFields​(java.lang.String filteringScope)
      Get fields for given entity-filtering scope.
      java.util.Set<java.lang.String> getFields​(java.lang.String... filteringScopes)
      Get fields for given entity-filtering scopes.
      java.util.Set<java.lang.String> getFields​(java.util.Set<java.lang.String> filteringScopes)
      Get fields for given entity-filtering scopes.
      java.util.Set<java.lang.String> getFilteringScopes()
      Get all available entity-filtering scopes.
      java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.lang.String filteringScope)
      Get subgraphs for given entity-filtering scope.
      java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.lang.String... filteringScopes)
      Get subgraphs for given entity-filtering scopes.
      java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.util.Set<java.lang.String> filteringScopes)
      Get subgraphs for given entity-filtering scopes.
      int hashCode()  
      boolean presentInScope​(java.lang.String field, java.lang.String filteringScope)
      Determines whether a field/subgraph is present in ANY of the given scopes.
      boolean presentInScopes​(java.lang.String field)
      Determines whether a field/subgraph is present in ANY of the existing scopes.
      EntityGraph remove​(java.lang.String name)
      Remove a field/subgraph from the graph (all entity-filtering scopes).
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clazz

        private final java.lang.Class<?> clazz
    • Constructor Detail

      • EmptyEntityGraphImpl

        EmptyEntityGraphImpl​(java.lang.Class<?> clazz)
    • Method Detail

      • addField

        public EntityGraph addField​(java.lang.String fieldName)
        Description copied from interface: EntityGraph
        Add a field into this graph for all existing entity-filtering scopes.
        Specified by:
        addField in interface EntityGraph
        Parameters:
        fieldName - name of the field to be added.
        Returns:
        an entity-filtering graph instance.
      • addField

        public EntityGraph addField​(java.lang.String fieldName,
                                    java.lang.String... filteringScopes)
        Description copied from interface: EntityGraph
        Add a field into this graph for given list of entity-filtering scopes.
        Specified by:
        addField in interface EntityGraph
        Parameters:
        fieldName - name of the field to be added.
        filteringScopes - entity-filtering scopes for the field.
        Returns:
        an entity-filtering graph instance.
      • addField

        public EntityGraph addField​(java.lang.String fieldName,
                                    java.util.Set<java.lang.String> filteringScopes)
        Description copied from interface: EntityGraph
        Add a field into this graph for given set of entity-filtering scopes.
        Specified by:
        addField in interface EntityGraph
        Parameters:
        fieldName - name of the field to be added.
        filteringScopes - entity-filtering scopes for the field.
        Returns:
        an entity-filtering graph instance.
      • addSubgraph

        public EntityGraph addSubgraph​(java.lang.String fieldName,
                                       java.lang.Class<?> fieldClass)
        Description copied from interface: EntityGraph
        Add a subgraph into this graph for all existing entity-filtering scopes.
        Specified by:
        addSubgraph in interface EntityGraph
        Parameters:
        fieldName - name of the subgraph field to be added.
        fieldClass - entity class representing the subgraph.
        Returns:
        an entity-filtering graph instance.
      • addSubgraph

        public EntityGraph addSubgraph​(java.lang.String fieldName,
                                       java.lang.Class<?> fieldClass,
                                       java.lang.String... filteringScopes)
        Description copied from interface: EntityGraph
        Add a subgraph into this graph for given list of entity-filtering scopes.
        Specified by:
        addSubgraph in interface EntityGraph
        Parameters:
        fieldName - name of the subgraph field to be added.
        fieldClass - entity class representing the subgraph.
        filteringScopes - entity-filtering scopes for the subgraph.
        Returns:
        an entity-filtering graph instance.
      • addSubgraph

        public EntityGraph addSubgraph​(java.lang.String fieldName,
                                       java.lang.Class<?> fieldClass,
                                       java.util.Set<java.lang.String> filteringScopes)
        Description copied from interface: EntityGraph
        Add a subgraph into this graph for given set of entity-filtering scopes.
        Specified by:
        addSubgraph in interface EntityGraph
        Parameters:
        fieldName - name of the subgraph field to be added.
        fieldClass - entity class representing the subgraph.
        filteringScopes - entity-filtering scopes for the subgraph.
        Returns:
        an entity-filtering graph instance.
      • getEntityClass

        public java.lang.Class<?> getEntityClass()
        Description copied from interface: EntityGraph
        Get an entity class this graph is created for.
        Specified by:
        getEntityClass in interface EntityGraph
        Returns:
        an entity class.
      • getFields

        public java.util.Set<java.lang.String> getFields​(java.lang.String filteringScope)
        Description copied from interface: EntityGraph
        Get fields for given entity-filtering scope.
        Specified by:
        getFields in interface EntityGraph
        Parameters:
        filteringScope - scope the returned fields have to be in.
        Returns:
        set of fields present in given scope.
      • getFields

        public java.util.Set<java.lang.String> getFields​(java.lang.String... filteringScopes)
        Description copied from interface: EntityGraph
        Get fields for given entity-filtering scopes.
        Specified by:
        getFields in interface EntityGraph
        Parameters:
        filteringScopes - scopes the returned fields have to be in.
        Returns:
        set of fields present in given scopes.
      • getFields

        public java.util.Set<java.lang.String> getFields​(java.util.Set<java.lang.String> filteringScopes)
        Description copied from interface: EntityGraph
        Get fields for given entity-filtering scopes.
        Specified by:
        getFields in interface EntityGraph
        Parameters:
        filteringScopes - scopes the returned fields have to be in.
        Returns:
        set of fields present in given scopes.
      • getSubgraphs

        public java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.lang.String filteringScope)
        Description copied from interface: EntityGraph
        Get subgraphs for given entity-filtering scope.
        Specified by:
        getSubgraphs in interface EntityGraph
        Parameters:
        filteringScope - scope the returned subgraphs have to be in.
        Returns:
        map of subgraphs present in given scope.
      • getSubgraphs

        public java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.lang.String... filteringScopes)
        Description copied from interface: EntityGraph
        Get subgraphs for given entity-filtering scopes.
        Specified by:
        getSubgraphs in interface EntityGraph
        Parameters:
        filteringScopes - scopes the returned subgraphs have to be in.
        Returns:
        map of subgraphs present in given scopes.
      • getSubgraphs

        public java.util.Map<java.lang.String,​java.lang.Class<?>> getSubgraphs​(java.util.Set<java.lang.String> filteringScopes)
        Description copied from interface: EntityGraph
        Get subgraphs for given entity-filtering scopes.
        Specified by:
        getSubgraphs in interface EntityGraph
        Parameters:
        filteringScopes - scopes the returned subgraphs have to be in.
        Returns:
        map of subgraphs present in given scopes.
      • presentInScopes

        public boolean presentInScopes​(java.lang.String field)
        Description copied from interface: EntityGraph
        Determines whether a field/subgraph is present in ANY of the existing scopes.
        Specified by:
        presentInScopes in interface EntityGraph
        Parameters:
        field - field to be checked.
        Returns:
        true if field is present in ANY of the existing scopes, false otherwise.
      • presentInScope

        public boolean presentInScope​(java.lang.String field,
                                      java.lang.String filteringScope)
        Description copied from interface: EntityGraph
        Determines whether a field/subgraph is present in ANY of the given scopes. If no scopes are given the return value determines whether the field is present in any scope.
        Specified by:
        presentInScope in interface EntityGraph
        Parameters:
        field - field to be checked.
        filteringScope - entity-filtering scope.
        Returns:
        true if field is present in the given scope, false otherwise.
      • remove

        public EntityGraph remove​(java.lang.String name)
        Description copied from interface: EntityGraph
        Remove a field/subgraph from the graph (all entity-filtering scopes).
        Specified by:
        remove in interface EntityGraph
        Parameters:
        name - name of the field/subgraph to be removed.
        Returns:
        an entity-filtering graph instance.
      • getFilteringScopes

        public java.util.Set<java.lang.String> getFilteringScopes()
        Description copied from interface: EntityGraph
        Get all available entity-filtering scopes.
        Specified by:
        getFilteringScopes in interface EntityGraph
        Returns:
        all available entity-filtering scopes.
      • getClassFilteringScopes

        public java.util.Set<java.lang.String> getClassFilteringScopes()
        Description copied from interface: EntityGraph
        Get all available entity-filtering scopes defined on a class.
        Specified by:
        getClassFilteringScopes in interface EntityGraph
        Returns:
        all available entity-filtering scopes.
      • addFilteringScopes

        public EntityGraph addFilteringScopes​(java.util.Set<java.lang.String> filteringScopes)
        Description copied from interface: EntityGraph
        Add a set of entity-filtering scopes to this graph.
        Specified by:
        addFilteringScopes in interface EntityGraph
        Parameters:
        filteringScopes - entity-filtering scopes to be added.
        Returns:
        an entity-filtering graph instance.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object