Interface EdgeEntity


public interface EdgeEntity
It is a wrapper of Edge that links two Entity. Along with its Property objects, an Edge has both a Direction and a label. Any Change at the Edge is automatically continued in the database. However, any, change in the Entity will be ignored. Template.update(Object)
outVertex ---label---> inVertex.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String key, Object value)
    Adds a new property to this edge with the specified key and value.
    void
    add(String key, org.eclipse.jnosql.communication.Value value)
    Adds a new property to this edge with the specified key and value.
    void
    Deletes this edge from the database.
    Optional<org.eclipse.jnosql.communication.Value>
    get(String key)
    Returns the property value associated with the specified key, if present.
    id()
    Returns the identifier of this edge.
    <T> T
    id(Class<T> type)
    Returns the identifier of this edge converted to the specified type.
    <T> T
    Retrieves the incoming entity connected to this edge.
    boolean
    Returns true if this edge contains no properties.
    Returns the label of this edge.
    static EdgeEntity
    of(org.eclipse.jnosql.mapping.semistructured.EntityConverter converter, org.apache.tinkerpop.gremlin.structure.Edge edge)
    Creates an EdgeEntity instance from the provided EntityConverter and Edge.
    <T> T
    Retrieves the outgoing entity connected to this edge.
    List<org.eclipse.jnosql.communication.semistructured.Element>
    Returns the properties of this edge.
    void
    Removes the property with the specified key from this edge.
    int
    Returns the number of properties in this edge.
  • Method Details

    • id

      Object id()
      Returns the identifier of this edge.
      Returns:
      the identifier of this edge
    • id

      <T> T id(Class<T> type)
      Returns the identifier of this edge converted to the specified type.
      Type Parameters:
      T - the type to convert the identifier to
      Parameters:
      type - the class type to convert the identifier to
      Returns:
      the identifier of this edge converted to the specified type
    • label

      String label()
      Returns the label of this edge.
      Returns:
      the label of this edge
    • incoming

      <T> T incoming()
      Retrieves the incoming entity connected to this edge.
      Type Parameters:
      T - the type of the incoming entity
      Returns:
      the incoming entity connected to this edge
    • outgoing

      <T> T outgoing()
      Retrieves the outgoing entity connected to this edge.
      Type Parameters:
      T - the type of the outgoing entity
      Returns:
      the outgoing entity connected to this edge
    • properties

      List<org.eclipse.jnosql.communication.semistructured.Element> properties()
      Returns the properties of this edge.
      Returns:
      the properties of this edge
    • add

      void add(String key, Object value)
      Adds a new property to this edge with the specified key and value.
      Parameters:
      key - the key of the property
      value - the value of the property
      Throws:
      NullPointerException - if either key or value is null
    • add

      void add(String key, org.eclipse.jnosql.communication.Value value)
      Adds a new property to this edge with the specified key and value.
      Parameters:
      key - the key of the property
      value - the value of the property
      Throws:
      NullPointerException - if either key or value is null
    • remove

      void remove(String key)
      Removes the property with the specified key from this edge.
      Parameters:
      key - the key of the property to be removed
      Throws:
      NullPointerException - if the key is null
    • get

      Optional<org.eclipse.jnosql.communication.Value> get(String key)
      Returns the property value associated with the specified key, if present.
      Parameters:
      key - the key of the property to retrieve
      Returns:
      the value associated with the specified key, or Optional.empty() if the key is not present
      Throws:
      NullPointerException - if the key is null
    • isEmpty

      boolean isEmpty()
      Returns true if this edge contains no properties.
      Returns:
      true if this edge contains no properties
    • size

      int size()
      Returns the number of properties in this edge.
      Returns:
      the number of properties in this edge
    • delete

      void delete()
      Deletes this edge from the database. After this operation, any modification attempts such as adding or removing properties will result in an illegal state.
    • of

      static EdgeEntity of(org.eclipse.jnosql.mapping.semistructured.EntityConverter converter, org.apache.tinkerpop.gremlin.structure.Edge edge)
      Creates an EdgeEntity instance from the provided EntityConverter and Edge.
      Parameters:
      converter - the entity converter to use
      edge - the edge to create the entity from
      Returns:
      the created EdgeEntity instance
      Throws:
      NullPointerException - if either converter or edge is null