E - The type of the element. Either VertexElement of EdgeElementP - Enum indicating the allowed properties on each type. Either Schema.VertexProperty or
Schema.EdgePropertypublic abstract class AbstractElement<E extends org.apache.tinkerpop.gremlin.structure.Element,P extends Enum> extends Object
GraknTx AbstractElement
Base class used to represent a construct in the graph. This includes exposed constructs such as Concept
and hidden constructs such as EdgeElement and Casting
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the element from the graph
|
E |
element() |
boolean |
equals(Object object) |
int |
hashCode() |
ElementId |
id() |
boolean |
isDeleted() |
String |
label() |
<X> X |
property(P key) |
void |
property(P key,
Object value) |
Boolean |
propertyBoolean(P key) |
<X> void |
propertyImmutable(P property,
X newValue,
X foundValue) |
<X> void |
propertyImmutable(P property,
X newValue,
X foundValue,
java.util.function.Function<X,Object> converter)
Sets a property which cannot be mutated
|
void |
propertyUnique(P key,
String value)
Sets the value of a property with the added restriction that no other vertex can have that property.
|
EmbeddedGraknTx<?> |
tx() |
public E element()
public ElementId id()
public void delete()
public void property(P key, Object value)
key - The key of the property to mutatevalue - The value to commit into the property@Nullable public <X> X property(P key)
key - The key of the non-unique property to retrievepublic EmbeddedGraknTx<?> tx()
public int hashCode()
public boolean equals(Object object)
public void propertyUnique(P key, String value)
key - The key of the unique property to mutatevalue - The new value of the unique propertypublic <X> void propertyImmutable(P property, X newValue, @Nullable X foundValue, java.util.function.Function<X,Object> converter)
property - The key of the immutable property to mutatenewValue - The new value to put on the property (if the property is not set)foundValue - The current value of the propertyconverter - Helper method to ensure data is persisted in the correct formatpublic <X> void propertyImmutable(P property, X newValue, X foundValue)
public String label()
public final boolean isDeleted()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.