public abstract class AbstractElement extends Object implements InternalElement, Comparable<JanusGraphElement>
For the id, it holds that: id<0: Temporary id, will be assigned id>0 when the transaction is committed id=0: Virtual or implicit element that does not physically exist in the database id>0: Physically persisted element
| Constructor and Description |
|---|
AbstractElement(Object id) |
| Modifier and Type | Method and Description |
|---|---|
InternalVertex |
clone() |
static int |
compare(JanusGraphElement e1,
JanusGraphElement e2) |
int |
compareTo(JanusGraphElement other) |
boolean |
equals(Object other) |
Object |
getCompareId()
Long identifier used to compare elements.
|
int |
hashCode() |
boolean |
hasId()
Checks whether this entity has a unique identifier.
|
Object |
id()
Returns a unique identifier for this entity.
|
boolean |
isInvisible()
Whether this element is invisible and should only be returned to queries that explicitly ask for invisible elements.
|
boolean |
isLoaded()
Checks whether this entity has been loaded into the current transaction and not yet modified.
|
boolean |
isNew()
Checks whether this entity has been newly created in the current transaction.
|
boolean |
isRemoved()
Checks whether this entity has been deleted into the current transaction.
|
static boolean |
isTemporaryId(Object elementId) |
void |
setId(Object id) |
finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetLifeCycle, graph, it, txproperty, remove, valueOrNullpublic AbstractElement(Object id)
public static boolean isTemporaryId(Object elementId)
public int compareTo(JanusGraphElement other)
compareTo in interface Comparable<JanusGraphElement>public static int compare(JanusGraphElement e1, JanusGraphElement e2)
public InternalVertex clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic Object getCompareId()
id()
but some instances of elements may be considered the same even if their ids differ. In that case,
this method should be overwritten to return an id that can be used for comparison.getCompareId in interface InternalElementpublic Object id()
JanusGraphElementThe unique identifier may only be set when the transaction in which entity is created commits. Some entities are never assigned a unique identifier if they depend on a parent entity.
JanusGraph allocates blocks of identifiers and automatically assigns identifiers to elements
automatically be default. This behavior can be partially overridden by setting
GraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID
id in interface org.apache.tinkerpop.gremlin.structure.Elementid in interface Idfiableid in interface JanusGraphElementJanusGraphElement.hasId()public boolean hasId()
JanusGraphElementNote that some entities may never be assigned an identifier and others will only be assigned an identifier at the end of a transaction.
hasId in interface JanusGraphElementpublic void setId(Object id)
setId in interface InternalElementpublic boolean isInvisible()
InternalElementisInvisible in interface InternalElementpublic boolean isNew()
JanusGraphElementisNew in interface JanusGraphElementpublic boolean isLoaded()
JanusGraphElementisLoaded in interface JanusGraphElementpublic boolean isRemoved()
JanusGraphElementisRemoved in interface JanusGraphElementCopyright © 2012–2024. All rights reserved.