Package org.neo4j.cypherdsl.core
Class RelationshipChain
- java.lang.Object
-
- org.neo4j.cypherdsl.core.RelationshipChain
-
- All Implemented Interfaces:
ExposesRelationships<RelationshipChain>,PatternElement,RelationshipPattern,Visitable
@API(status=EXPERIMENTAL, since="1.0") public final class RelationshipChain extends java.lang.Object implements RelationshipPatternRepresents a chain of relationships. The chain is meant to be in order and the right node of an element is related to the left node of the next element.- Since:
- 1.0
- Author:
- Michael J. Simons
-
-
Constructor Summary
Constructors Constructor Description RelationshipChain()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)RelationshipChainlength(java.lang.Integer minimum, java.lang.Integer maximum)Changes the length of the last element of this chainRelationshipChainmax(java.lang.Integer maximum)Changes the length of the last element of this chain to a new maximum lengthRelationshipChainmin(java.lang.Integer minimum)Changes the length of the last element of this chain to a new minimum lengthRelationshipChainnamed(java.lang.String newSymbolicName)Replaces the last element of this chains with a copy of the relationship with the new symbolic name.RelationshipChainproperties(java.lang.Object... keysAndValues)Adds properties to the last element of this chain.RelationshipChainproperties(MapExpression newProperties)Adds properties to the last element of this chain.RelationshipChainrelationshipBetween(Node other, java.lang.String... types)Starts building an undirected relationship between thisnodeand theother.RelationshipChainrelationshipFrom(Node other, java.lang.String... types)Starts building an incoming relationship starting at theothernode.RelationshipChainrelationshipTo(Node other, java.lang.String... types)Starts building an outgoing relationship to theothernode.RelationshipChainunbounded()Changes the length of the last element of this chain to an unbounded pattern.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.neo4j.cypherdsl.core.RelationshipPattern
asCondition
-
-
-
-
Method Detail
-
relationshipTo
public RelationshipChain relationshipTo(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an outgoing relationship to theothernode.- Specified by:
relationshipToin interfaceExposesRelationships<RelationshipChain>- Parameters:
other- The other end of the outgoing relationshiptypes- The types to match- Returns:
- An ongoing relationship definition, that can be used to specify the type
-
relationshipFrom
public RelationshipChain relationshipFrom(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an incoming relationship starting at theothernode.- Specified by:
relationshipFromin interfaceExposesRelationships<RelationshipChain>- Parameters:
other- The source of the incoming relationshiptypes- The types to match- Returns:
- An ongoing relationship definition, that can be used to specify the type
-
relationshipBetween
public RelationshipChain relationshipBetween(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an undirected relationship between thisnodeand theother.- Specified by:
relationshipBetweenin interfaceExposesRelationships<RelationshipChain>- Parameters:
other- The other end of the relationshiptypes- The types to match- Returns:
- An ongoing relationship definition, that can be used to specify the type
-
named
public 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:
namedin interfaceRelationshipPattern- Parameters:
newSymbolicName- The new symbolic name to use- Returns:
- This chain
-
unbounded
public RelationshipChain unbounded()
Changes the length of the last element of this chain to an unbounded pattern.- Returns:
- This chain
- Since:
- 1.1.1
-
min
public RelationshipChain min(java.lang.Integer minimum)
Changes the length of the last element of this chain to a new minimum length- Parameters:
minimum- the new minimum- Returns:
- This chain
-
max
public RelationshipChain max(java.lang.Integer maximum)
Changes the length of the last element of this chain to a new maximum length- Parameters:
maximum- the new maximum- Returns:
- This chain
-
length
public RelationshipChain length(java.lang.Integer minimum, java.lang.Integer maximum)
Changes the length of the last element of this chain- Parameters:
minimum- the new minimummaximum- the new maximum- Returns:
- This chain
-
properties
public 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:
- This chain
-
properties
public 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 alternatingStringandExpression.- Returns:
- This chain
-
-