Class EmptyEntityGraphImpl

java.lang.Object
org.glassfish.jersey.message.filtering.EmptyEntityGraphImpl
All Implemented Interfaces:
EntityGraph

final class EmptyEntityGraphImpl extends 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 Details

    • clazz

      private final Class<?> clazz
  • Constructor Details

    • EmptyEntityGraphImpl

      EmptyEntityGraphImpl(Class<?> clazz)
  • Method Details

    • addField

      public EntityGraph addField(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(String fieldName, 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(String fieldName, Set<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(String fieldName, 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(String fieldName, Class<?> fieldClass, 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(String fieldName, Class<?> fieldClass, Set<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 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 Set<String> getFields(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 Set<String> getFields(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 Set<String> getFields(Set<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 Map<String,Class<?>> getSubgraphs(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 Map<String,Class<?>> getSubgraphs(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 Map<String,Class<?>> getSubgraphs(Set<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(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(String field, 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(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 Set<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 Set<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(Set<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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object