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)
EntityGraph
addField
in interface EntityGraph
fieldName
- name of the field to be added.public EntityGraphImpl addField(java.lang.String fieldName, java.lang.String... filteringScopes)
EntityGraph
addField
in interface EntityGraph
fieldName
- 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)
EntityGraph
addField
in interface EntityGraph
fieldName
- name of the field to be added.filteringScopes
- entity-filtering scopes for the field.public EntityGraphImpl addFilteringScopes(java.util.Set<java.lang.String> filteringScopes)
EntityGraph
addFilteringScopes
in interface EntityGraph
filteringScopes
- entity-filtering scopes to be added.public EntityGraphImpl addSubgraph(java.lang.String fieldName, java.lang.Class<?> fieldClass)
EntityGraph
addSubgraph
in interface EntityGraph
fieldName
- 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)
EntityGraph
addSubgraph
in interface EntityGraph
fieldName
- 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)
EntityGraph
addSubgraph
in interface EntityGraph
fieldName
- 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()
EntityGraph
getEntityClass
in interface EntityGraph
public java.util.Set<java.lang.String> getFields(java.lang.String filteringScope)
EntityGraph
getFields
in interface EntityGraph
filteringScope
- scope the returned fields have to be in.public java.util.Set<java.lang.String> getFields(java.lang.String... filteringScopes)
EntityGraph
getFields
in interface EntityGraph
filteringScopes
- scopes the returned fields have to be in.public java.util.Set<java.lang.String> getFields(java.util.Set<java.lang.String> filteringScopes)
EntityGraph
getFields
in interface EntityGraph
filteringScopes
- scopes the returned fields have to be in.public java.util.Set<java.lang.String> getFilteringScopes()
EntityGraph
getFilteringScopes
in interface EntityGraph
public java.util.Set<java.lang.String> getClassFilteringScopes()
EntityGraph
getClassFilteringScopes
in interface EntityGraph
public java.util.Map<java.lang.String,java.lang.Class<?>> getSubgraphs(java.lang.String filteringScope)
EntityGraph
getSubgraphs
in interface EntityGraph
filteringScope
- scope the returned subgraphs have to be in.public java.util.Map<java.lang.String,java.lang.Class<?>> getSubgraphs(java.lang.String... filteringScopes)
EntityGraph
getSubgraphs
in interface EntityGraph
filteringScopes
- 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)
EntityGraph
getSubgraphs
in interface EntityGraph
filteringScopes
- scopes the returned subgraphs have to be in.public boolean presentInScopes(java.lang.String name)
EntityGraph
presentInScopes
in interface EntityGraph
name
- 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)
EntityGraph
presentInScope
in interface EntityGraph
field
- 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)
EntityGraph
remove
in interface EntityGraph
fieldName
- 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.Object
public int hashCode()
hashCode
in class java.lang.Object