Interface ExposesRelationships<T extends RelationshipPattern & ExposesPatternLengthAccessors<?>>

Type Parameters:
T - The type of the resulting RelationshipPattern.
All Known Subinterfaces:
Node, Relationship, RelationshipPattern
All Known Implementing Classes:
NodeBase, RelationshipBase, RelationshipChain

@API(status=STABLE, since="1.0") public interface ExposesRelationships<T extends RelationshipPattern & ExposesPatternLengthAccessors<?>>
A marker interface for things that expose methods to create new relationships to other elements.
Since:
1.0
Author:
Michael J. Simons
  • Method Details

    • relationshipTo

      @NotNull @Contract(pure=true) T relationshipTo(Node other, String... types)
      Starts building an outgoing relationship to the other node.
      Parameters:
      other - The other end of the outgoing relationship
      types - The types to match
      Returns:
      An ongoing relationship definition, that can be used to specify the type
    • relationshipFrom

      @NotNull @Contract(pure=true) T relationshipFrom(Node other, String... types)
      Starts building an incoming relationship starting at the other node.
      Parameters:
      other - The source of the incoming relationship
      types - The types to match
      Returns:
      An ongoing relationship definition, that can be used to specify the type
    • relationshipBetween

      @NotNull @Contract(pure=true) T relationshipBetween(Node other, String... types)
      Starts building an undirected relationship between this node and the other.
      Parameters:
      other - The other end of the relationship
      types - The types to match
      Returns:
      An ongoing relationship definition, that can be used to specify the type
    • relationshipWith

      default T relationshipWith(Node other, Relationship.Direction direction, String... types)
      A convenience method for creating relationships between nodes avoiding going through the fluent API by allowing to pass in the type directly.
      Parameters:
      other - The other end of the relationship
      direction - The direction of the relationship, seen from this node
      types - The type of the relationship to create or the types to match
      Returns:
      An ongoing relationship definition, that can be used to specify details of the relationship
      Since:
      2023.5.0