Package oracle.pgx.api
Class PgxEntity<ID>
java.lang.Object
oracle.pgx.api.internal.ApiObject
oracle.pgx.api.PgxEntity<ID>
- Type Parameters:
ID- the ID type of this entity
public abstract class PgxEntity<ID>
extends oracle.pgx.api.internal.ApiObject
An abstraction of vertex and edge.
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetGraph()Gets the graph.getId()Gets the id.<V> VgetProperty(String propertyName) Blocking version ofgetPropertyAsync(String).<V> PgxFuture<V>getPropertyAsync(String propertyName) Gets the value of a property.getType()Gets the type.inthashCode()Method to get the entity as an object that can be serialized for algorithms.<V> voidsetProperty(String propertyName, V value) Blocking version ofsetPropertyAsync(String, Object).setPropertyAsync(String propertyName, V value) Sets the value of a property.toString()
-
Method Details
-
getGraph
Gets the graph.- Returns:
- the graph the entity is bound to
-
serialize
Method to get the entity as an object that can be serialized for algorithms. -
getId
Gets the id.- Returns:
- the entity's id
-
getType
Gets the type.- Returns:
- the entity's type
-
getPropertyAsync
Gets the value of a property.NOTE: If you want to iterate over all values of a property, use
Property.getValuesAsync()instead.- Parameters:
propertyName- the property name- Returns:
- the value
-
setPropertyAsync
Sets the value of a property.NOTE: If you want to set several values of a property, use
Property.setValuesAsync(Map)instead.- Parameters:
propertyName- the property namevalue- the value of the property- Returns:
- A future which completes once the value was set. The returned future will completely exceptionally if the given property does not exist.
-
equals
-
hashCode
public int hashCode() -
toString
-
getProperty
Blocking version ofgetPropertyAsync(String). CallsgetPropertyAsync(String)and waits for the returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
setProperty
public <V> void setProperty(String propertyName, V value) throws ExecutionException, InterruptedException Blocking version ofsetPropertyAsync(String, Object). CallssetPropertyAsync(String, Object)and waits for the returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-