Class ElementDefinitions<ENTITY_DEF extends ElementDefinition,EDGE_DEF extends ElementDefinition>
- java.lang.Object
-
- uk.gov.gchq.gaffer.data.elementdefinition.ElementDefinitions<ENTITY_DEF,EDGE_DEF>
-
- Type Parameters:
ENTITY_DEF- the type ofElementDefinitionfor the entitiesEDGE_DEF- the type ofElementDefinitionfor the edges
public class ElementDefinitions<ENTITY_DEF extends ElementDefinition,EDGE_DEF extends ElementDefinition> extends Object
Contains the full list of groups in the graph.
This class must be JSON serialisable. A schema should normally be written in JSON and then deserialised at runtime. Examples of JSON schemas can be found in the example projects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElementDefinitions.BaseBuilder<ELEMENT_DEFS extends ElementDefinitions<ENTITY_DEF,EDGE_DEF>,ENTITY_DEF extends ElementDefinition,EDGE_DEF extends ElementDefinition,CHILD_CLASS extends ElementDefinitions.BaseBuilder<ELEMENT_DEFS,ENTITY_DEF,EDGE_DEF,?>>Builder forElementDefinitions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)EDGE_DEFgetEdge(String group)Set<String>getEdgeGroups()Map<String,EDGE_DEF>getEdges()ElementDefinitiongetElement(String group)Looks the group up in the entity definitions then if it doesn't find a definition it will look it up in the edge definitions.Map<String,ENTITY_DEF>getEntities()ENTITY_DEFgetEntity(String group)Set<String>getEntityGroups()Set<String>getGroups()Returns a new hash set with all entity and edge groups.booleanhasEdges()booleanhasEntities()booleanhasGroups()inthashCode()booleanisEdge(String group)booleanisEntity(String group)byte[]toJson(boolean prettyPrint, String... fieldsToExclude)StringtoString()
-
-
-
Method Detail
-
toJson
public byte[] toJson(boolean prettyPrint, String... fieldsToExclude) throws SchemaException- Throws:
SchemaException
-
getElement
public ElementDefinition getElement(String group)
Looks the group up in the entity definitions then if it doesn't find a definition it will look it up in the edge definitions. If you know the type of the element (Entity or Edge) then use getEntity or getEdge.- Parameters:
group- an group- Returns:
- the
ElementDefinitionfor the given group
-
getEntity
public ENTITY_DEF getEntity(String group)
-
isEntity
public boolean isEntity(String group)
-
isEdge
public boolean isEdge(String group)
-
getGroups
public Set<String> getGroups()
Returns a new hash set with all entity and edge groups.- Returns:
- a new hash set with all entity and edge groups.
-
hasEntities
public boolean hasEntities()
-
hasEdges
public boolean hasEdges()
-
hasGroups
public boolean hasGroups()
-
getEntities
public Map<String,ENTITY_DEF> getEntities()
-
-