Class PgxEntity<ID>

  • Type Parameters:
    ID - the ID type of this entity
    Direct Known Subclasses:
    PgxEdge, PgxVertex

    public abstract class PgxEntity<ID>
    extends oracle.pgx.api.internal.ApiObject
    An abstraction of vertex and edge.
    • 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 name
        value - 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getProperty

        public <V> V getProperty​(java.lang.String propertyName)
                          throws java.util.concurrent.ExecutionException,
                                 java.lang.InterruptedException
        Blocking version of getPropertyAsync(String). Calls getPropertyAsync(String) and waits for the returned PgxFuture 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 of setPropertyAsync(String, Object). Calls setPropertyAsync(String, Object) and waits for the returned PgxFuture 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.