Class ElementDefinitions<ENTITY_DEF extends ElementDefinition,​EDGE_DEF extends ElementDefinition>

  • Type Parameters:
    ENTITY_DEF - the type of ElementDefinition for the entities
    EDGE_DEF - the type of ElementDefinition for the edges
    Direct Known Subclasses:
    Schema, View

    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.

    • Method Detail

      • 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 ElementDefinition for the given group
      • isEntity

        public boolean isEntity​(String group)
      • isEdge

        public boolean isEdge​(String group)
      • getEdgeGroups

        public Set<String> getEdgeGroups()
      • getEntityGroups

        public Set<String> getEntityGroups()
      • 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()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object