Class GraphEntity

  • Direct Known Subclasses:
    Edge, Node

    public abstract class GraphEntity
    extends Object
    This is an abstract class for representing a graph entity. A graph entity has an id and a set of properties. The properties are mapped and accessed by their names.
    • Field Detail

      • id

        protected long id
    • Constructor Detail

      • GraphEntity

        public GraphEntity()
    • Method Detail

      • getId

        public long getId()
        Returns:
        entity id
      • setId

        public void setId​(long id)
        Parameters:
        id - - entity id to be set
      • addProperty

        public void addProperty​(String name,
                                Object value)
        Adds a property to the entity, by composing name, type and value to a property object
        Parameters:
        name -
        value -
      • getEntityPropertyNames

        public Set<String> getEntityPropertyNames()
        Returns:
        Entity's property names, as a Set
      • addProperty

        public void addProperty​(Property property)
        Add a property to the entity
        Parameters:
        property -
      • getNumberOfProperties

        public int getNumberOfProperties()
        Returns:
        number of properties
      • getProperty

        public Property getProperty​(String propertyName)
        Parameters:
        propertyName - - property name as lookup key (String)
        Returns:
        property object, or null if key is not found
      • removeProperty

        public void removeProperty​(String name)
        Parameters:
        name - - the name of the property to be removed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object