Interface Relationship

All Superinterfaces:
Map<String,Object>

@ProviderType public interface Relationship extends Map<String,Object>
Relationship specifies an edge in the social graph and represents the relationship between two graph nodes (users, groups, topics).
  • Method Details

    • getStartNode

      GraphNode getStartNode()
      Returns the starting node of this relationship
      Returns:
      the starting node of this relationship
    • getEndNode

      GraphNode getEndNode()
      Returns the ending node of this relationship
      Returns:
      the ending node of this relationship
    • getOtherNode

      GraphNode getOtherNode(GraphNode node)
      A convenience operation that, given a node that is attached to this relationship, returns the other node.
      Parameters:
      node - the start or end node of this relationship
      Returns:
      the other node
    • isBidirectional

      boolean isBidirectional()
      Convenience operation that checks if this relationship is also established in the other direction.
      Returns:
      true if this relationship is bidirectional.
    • getType

      String getType()
      Returns the type of this relationship.
      Returns:
      the type of this relationship
    • isVirtual

      boolean isVirtual()
      Specifies tha this relationship is virtual and is not (and will never be) backed by a persistence object.
      Returns:
      true if this node is virtual.
    • delete

      void delete()
      Deletes this relationship.
    • signature

      String signature()
      Returns a signature of the relationship of the form: startNodeId ":" type ":" endNodeId, with the ids and type url encoded. the equals and hash methods should use this signature for equality check.
      Returns:
      the signature
    • get

      <T> T get(String name, Class<T> type)
      Get a named property and convert it into the given type.
      Type Parameters:
      T - the type
      Parameters:
      name - The name of the property
      type - The class of the type
      Returns:
      Return named value converted to type T or null if non existing or can't be converted.
    • get

      <T> T get(String name, T defaultValue)
      Get a named property and convert it into the given type.
      Type Parameters:
      T - the type
      Parameters:
      name - The name of the property
      defaultValue - The default value to use if the named property does not exist or cannot be converted to the requested type. The default value is also used to define the type to convert the value to. If this is null any existing property is not converted.
      Returns:
      Return named value converted to type T or the default value if non existing or can't be converted.