Class RelationshipChain

    • Method Detail

      • relationshipTo

        @NotNull
        public @NotNull RelationshipChain relationshipTo​(Node other,
                                                         java.lang.String... types)
        Description copied from interface: ExposesRelationships
        Starts building an outgoing relationship to the other node.
        Specified by:
        relationshipTo in interface ExposesRelationships<RelationshipChain>
        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
        public @NotNull RelationshipChain relationshipFrom​(Node other,
                                                           java.lang.String... types)
        Description copied from interface: ExposesRelationships
        Starts building an incoming relationship starting at the other node.
        Specified by:
        relationshipFrom in interface ExposesRelationships<RelationshipChain>
        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
        public @NotNull RelationshipChain relationshipBetween​(Node other,
                                                              java.lang.String... types)
        Description copied from interface: ExposesRelationships
        Starts building an undirected relationship between this node and the other.
        Specified by:
        relationshipBetween in interface ExposesRelationships<RelationshipChain>
        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
      • named

        @NotNull
        public @NotNull RelationshipChain named​(java.lang.String newSymbolicName)
        Replaces the last element of this chains with a copy of the relationship with the new symbolic name.
        Specified by:
        named in interface RelationshipPattern
        Parameters:
        newSymbolicName - The new symbolic name to use
        Returns:
        A new chain
      • named

        @NotNull
        public @NotNull RelationshipChain named​(SymbolicName newSymbolicName)
        Replaces the last element of this chains with a copy of the relationship with the new symbolic name.
        Specified by:
        named in interface RelationshipPattern
        Parameters:
        newSymbolicName - The new symbolic name to use
        Returns:
        A new chain
        Since:
        2021.1.1
      • length

        @NotNull
        @Contract(pure=true)
        public @NotNull RelationshipChain length​(java.lang.Integer minimum,
                                                 java.lang.Integer maximum)
        Changes the length of the last element of this chain
        Specified by:
        length in interface ExposesPatternLengthAccessors<RelationshipChain>
        Parameters:
        minimum - the new minimum
        maximum - the new maximum
        Returns:
        A new chain
      • properties

        @NotNull
        @Contract(pure=true)
        public @NotNull RelationshipChain properties​(MapExpression newProperties)
        Adds properties to the last element of this chain.
        Parameters:
        newProperties - the new properties (can be null to remove exiting properties).
        Returns:
        A new chain
      • properties

        @NotNull
        @Contract(pure=true)
        public @NotNull RelationshipChain properties​(java.lang.Object... keysAndValues)
        Adds properties to the last element of this chain.
        Parameters:
        keysAndValues - A list of key and values. Must be an even number, with alternating String and Expression.
        Returns:
        A new chain
      • asCondition

        @NotNull
        public @NotNull Condition asCondition()
        Description copied from interface: RelationshipPattern
        Transform this pattern into a condition. All names of the patterns must be known upfront in the final statement, as PatternExpressions are not allowed to introduce new variables.
        Specified by:
        asCondition in interface RelationshipPattern
        Returns:
        A condition based on this pattern.
      • accept

        public void accept​(Visitor visitor)
        Description copied from interface: Visitable
        Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
        Specified by:
        accept in interface Visitable
        Parameters:
        visitor - the visitor to notify, must not be null.