Interface Relationship

  • All Superinterfaces:
    java.util.Map<java.lang.String,​java.lang.Object>

    @ProviderType
    public interface Relationship
    extends java.util.Map<java.lang.String,​java.lang.Object>
    Relationship specifies an edge in the social graph and represents the relationship between two graph nodes (users, groups, topics).
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete()
      Deletes this relationship.
      <T> T get​(java.lang.String name, java.lang.Class<T> type)
      Get a named property and convert it into the given type.
      <T> T get​(java.lang.String name, T defaultValue)
      Get a named property and convert it into the given type.
      GraphNode getEndNode()
      Returns the ending node of this relationship
      GraphNode getOtherNode​(GraphNode node)
      A convenience operation that, given a node that is attached to this relationship, returns the other node.
      GraphNode getStartNode()
      Returns the starting node of this relationship
      java.lang.String getType()
      Returns the type of this relationship.
      boolean isBidirectional()
      Convenience operation that checks if this relationship is also established in the other direction.
      boolean isVirtual()
      Specifies tha this relationship is virtual and is not (and will never be) backed by a persistence object.
      java.lang.String signature()
      Returns a signature of the relationship of the form: startNodeId ":" type ":" endNodeId, with the ids and type url encoded.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Method Detail

      • 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

        java.lang.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

        java.lang.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​(java.lang.String name,
                  java.lang.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​(java.lang.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.