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 TypeMethodDescriptionvoidAdds a new property to this edge with the specified key and value.voidAdds a new property to this edge with the specified key and value.voiddelete()Deletes this edge from the database.Optional<org.eclipse.jnosql.communication.Value>Returns the property value associated with the specified key, if present.id()Returns the identifier of this edge.<T> TReturns the identifier of this edge converted to the specified type.<T> Tincoming()Retrieves the incoming entity connected to this edge.booleanisEmpty()Returns true if this edge contains no properties.label()Returns the label of this edge.static EdgeEntityof(org.eclipse.jnosql.mapping.semistructured.EntityConverter converter, org.apache.tinkerpop.gremlin.structure.Edge edge) <T> Toutgoing()Retrieves the outgoing entity connected to this edge.List<org.eclipse.jnosql.communication.semistructured.Element>Returns the properties of this edge.voidRemoves the property with the specified key from this edge.intsize()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
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
Adds a new property to this edge with the specified key and value.- Parameters:
key- the key of the propertyvalue- the value of the property- Throws:
NullPointerException- if either key or value is null
-
add
Adds a new property to this edge with the specified key and value.- Parameters:
key- the key of the propertyvalue- the value of the property- Throws:
NullPointerException- if either key or value is null
-
remove
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
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) - Parameters:
converter- the entity converter to useedge- the edge to create the entity from- Returns:
- the created
EdgeEntityinstance - Throws:
NullPointerException- if either converter or edge is null
-