Package oracle.pgx.api
Class PgxEntity<ID>
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.PgxEntity<ID>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)PgxGraphgetGraph()Gets the graph.IDgetId()Gets the id.<V> VgetProperty(java.lang.String propertyName)Blocking version ofgetPropertyAsync(String).<V> PgxFuture<V>getPropertyAsync(java.lang.String propertyName)Gets the value of a property.IdTypegetType()Gets the type.inthashCode()java.lang.Objectserialize()Method to get the entity as an object that can be serialized for algorithms.<V> voidsetProperty(java.lang.String propertyName, V value)Blocking version ofsetPropertyAsync(String, Object).<V> PgxFuture<java.lang.Void>setPropertyAsync(java.lang.String propertyName, V value)Sets the value of a property.java.lang.StringtoString()
-
-
-
Method Detail
-
getGraph
public PgxGraph getGraph()
Gets the graph.- Returns:
- the graph the entity is bound to
-
serialize
public java.lang.Object serialize()
Method to get the entity as an object that can be serialized for algorithms.
-
getId
public ID getId()
Gets the id.- Returns:
- the entity's id
-
getType
public IdType getType()
Gets the type.- Returns:
- the entity's type
-
getPropertyAsync
public <V> PgxFuture<V> getPropertyAsync(java.lang.String propertyName)
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
public <V> PgxFuture<java.lang.Void> setPropertyAsync(java.lang.String propertyName, V value)
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
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getProperty
public <V> V getProperty(java.lang.String propertyName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofgetPropertyAsync(String). CallsgetPropertyAsync(String)and waits for the returnedPgxFutureto complete.- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
setProperty
public <V> void setProperty(java.lang.String propertyName, V value) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofsetPropertyAsync(String, Object). CallssetPropertyAsync(String, Object)and waits for the returnedPgxFutureto complete.- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
-