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 boolean
equals(java.lang.Object obj)
PgxGraph
getGraph()
Gets the graph.ID
getId()
Gets the id.<V> V
getProperty(java.lang.String propertyName)
Blocking version ofgetPropertyAsync(String)
.<V> PgxFuture<V>
getPropertyAsync(java.lang.String propertyName)
Gets the value of a property.IdType
getType()
Gets the type.int
hashCode()
java.lang.Object
serialize()
Method to get the entity as an object that can be serialized for algorithms.<V> void
setProperty(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.String
toString()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getProperty
public <V> V getProperty(java.lang.String propertyName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Blocking version ofgetPropertyAsync(String)
. CallsgetPropertyAsync(String)
and waits for the returnedPgxFuture
to 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.InterruptedException
Blocking version ofsetPropertyAsync(String, Object)
. CallssetPropertyAsync(String, Object)
and waits for the returnedPgxFuture
to 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.
-
-