final class EntityGraphImpl extends java.lang.Object implements EntityGraph
EntityGraph.| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<?> |
entityClass |
private com.google.common.collect.HashMultimap<java.lang.String,java.lang.String> |
fields |
private java.util.Set<java.lang.String> |
globalScopes |
private java.util.Set<java.lang.String> |
localScopes |
private com.google.common.collect.Table<java.lang.String,java.lang.String,java.lang.Class<?>> |
subgraphs |
| Constructor and Description |
|---|
EntityGraphImpl(java.lang.Class<?> entityClass)
Create an entity graph for given class.
|
| Modifier and Type | Method and Description |
|---|---|
EntityGraphImpl |
addField(java.lang.String fieldName)
Add a field into this graph for all existing entity-filtering scopes.
|
EntityGraphImpl |
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.
|
EntityGraphImpl |
addField(java.lang.String fieldName,
java.lang.String... filteringScopes)
Add a field into this graph for given list of entity-filtering scopes.
|
EntityGraphImpl |
addFilteringScopes(java.util.Set<java.lang.String> filteringScopes)
Add a set of entity-filtering scopes to this graph.
|
EntityGraphImpl |
addSubgraph(java.lang.String fieldName,
java.lang.Class<?> fieldClass)
Add a subgraph into this graph for all existing entity-filtering scopes.
|
EntityGraphImpl |
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.
|
EntityGraphImpl |
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.
|
private void |
createFilteringScope(java.lang.String filteringScope)
Create a new entity-filtering scope based on the
default one. |
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.util.Set<java.lang.String> filteringScopes)
Get fields for given entity-filtering scopes.
|
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.lang.String filteringScope)
Get fields for given entity-filtering scope.
|
java.util.Set<java.lang.String> |
getFilteringScopes()
Get all available 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.
|
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.lang.String filteringScope)
Get subgraphs for given entity-filtering scope.
|
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 name)
Determines whether a field/subgraph is present in ANY of the existing scopes.
|
EntityGraphImpl |
remove(java.lang.String fieldName)
Remove a field/subgraph from the graph (all entity-filtering scopes).
|
private final java.lang.Class<?> entityClass
private final java.util.Set<java.lang.String> globalScopes
private final java.util.Set<java.lang.String> localScopes
private final com.google.common.collect.HashMultimap<java.lang.String,java.lang.String> fields
private final com.google.common.collect.Table<java.lang.String,java.lang.String,java.lang.Class<?>> subgraphs
public EntityGraphImpl(java.lang.Class<?> entityClass)
entityClass - entity class the graph should be created for.public EntityGraphImpl addField(java.lang.String fieldName)
EntityGraphaddField in interface EntityGraphfieldName - name of the field to be added.public EntityGraphImpl addField(java.lang.String fieldName, java.lang.String... filteringScopes)
EntityGraphaddField in interface EntityGraphfieldName - name of the field to be added.filteringScopes - entity-filtering scopes for the field.public EntityGraphImpl addField(java.lang.String fieldName, java.util.Set<java.lang.String> filteringScopes)
EntityGraphaddField in interface EntityGraphfieldName - name of the field to be added.filteringScopes - entity-filtering scopes for the field.public EntityGraphImpl addFilteringScopes(java.util.Set<java.lang.String> filteringScopes)
EntityGraphaddFilteringScopes in interface EntityGraphfilteringScopes - entity-filtering scopes to be added.public EntityGraphImpl addSubgraph(java.lang.String fieldName, java.lang.Class<?> fieldClass)
EntityGraphaddSubgraph in interface EntityGraphfieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.public EntityGraphImpl addSubgraph(java.lang.String fieldName, java.lang.Class<?> fieldClass, java.lang.String... filteringScopes)
EntityGraphaddSubgraph in interface EntityGraphfieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.filteringScopes - entity-filtering scopes for the subgraph.public EntityGraphImpl addSubgraph(java.lang.String fieldName, java.lang.Class<?> fieldClass, java.util.Set<java.lang.String> filteringScopes)
EntityGraphaddSubgraph in interface EntityGraphfieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.filteringScopes - entity-filtering scopes for the subgraph.public java.lang.Class<?> getEntityClass()
EntityGraphgetEntityClass in interface EntityGraphpublic java.util.Set<java.lang.String> getFields(java.lang.String filteringScope)
EntityGraphgetFields in interface EntityGraphfilteringScope - scope the returned fields have to be in.public java.util.Set<java.lang.String> getFields(java.lang.String... filteringScopes)
EntityGraphgetFields in interface EntityGraphfilteringScopes - scopes the returned fields have to be in.public java.util.Set<java.lang.String> getFields(java.util.Set<java.lang.String> filteringScopes)
EntityGraphgetFields in interface EntityGraphfilteringScopes - scopes the returned fields have to be in.public java.util.Set<java.lang.String> getFilteringScopes()
EntityGraphgetFilteringScopes in interface EntityGraphpublic java.util.Set<java.lang.String> getClassFilteringScopes()
EntityGraphgetClassFilteringScopes in interface EntityGraphpublic java.util.Map<java.lang.String,java.lang.Class<?>> getSubgraphs(java.lang.String filteringScope)
EntityGraphgetSubgraphs in interface EntityGraphfilteringScope - scope the returned subgraphs have to be in.public java.util.Map<java.lang.String,java.lang.Class<?>> getSubgraphs(java.lang.String... filteringScopes)
EntityGraphgetSubgraphs in interface EntityGraphfilteringScopes - scopes the returned subgraphs have to be in.public java.util.Map<java.lang.String,java.lang.Class<?>> getSubgraphs(java.util.Set<java.lang.String> filteringScopes)
EntityGraphgetSubgraphs in interface EntityGraphfilteringScopes - scopes the returned subgraphs have to be in.public boolean presentInScopes(java.lang.String name)
EntityGraphpresentInScopes in interface EntityGraphname - field to be checked.true if field is present in ANY of the existing scopes, false otherwise.public boolean presentInScope(java.lang.String field,
java.lang.String filteringScope)
EntityGraphpresentInScope in interface EntityGraphfield - field to be checked.filteringScope - entity-filtering scope.true if field is present in the given scope, false otherwise.public EntityGraphImpl remove(java.lang.String fieldName)
EntityGraphremove in interface EntityGraphfieldName - name of the field/subgraph to be removed.private void createFilteringScope(java.lang.String filteringScope)
default one.filteringScope - entity-filtering scope to be created.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object