Package org.neo4j.cypherdsl.core
Class Relationship
- java.lang.Object
-
- org.neo4j.cypherdsl.core.Relationship
-
- All Implemented Interfaces:
ExposesProperties<Relationship>,ExposesRelationships<RelationshipChain>,Named,PatternElement,PropertyContainer,RelationshipPattern,Visitable
@API(status=EXPERIMENTAL, since="1.0") public final class Relationship extends java.lang.Object implements RelationshipPattern, PropertyContainer, ExposesProperties<Relationship>See RelationshipPattern.- Since:
- 1.0
- Author:
- Michael J. Simons, Philipp Tölle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRelationship.DetailsSee RelationshipDetail.static classRelationship.DirectionWhile the direction in the schema package is centered around the node, the direction here is the direction between two nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)Relationship.DetailsgetDetails()The details contains the types, properties and cardinality.SymbolicNamegetRequiredSymbolicName()java.util.Optional<SymbolicName>getSymbolicName()Relationshiplength(java.lang.Integer minimum, java.lang.Integer maximum)Creates a new relationship with a new lengthRelationshipmax(java.lang.Integer maximum)Creates a new relationship with a new maximum lengthRelationshipmin(java.lang.Integer minimum)Creates a new relationship with a new minimum lengthRelationshipnamed(java.lang.String newSymbolicName)Creates a copy of this relationship with a new symbolic name.Relationshipnamed(SymbolicName newSymbolicName)Creates a copy of this relationship with a new symbolic name.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.Relationshipunbounded()Creates a new relationship with an unbound length minimum lengthRelationshipwithProperties(java.lang.Object... keysAndValues)Creates a a copy of this property container with additional properties.RelationshipwithProperties(MapExpression newProperties)Creates a a copy of this property container with additional properties.-
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.PropertyContainer
mutate, mutate, project, project, property, property, property
-
Methods inherited from interface org.neo4j.cypherdsl.core.RelationshipPattern
asCondition
-
-
-
-
Method Detail
-
getDetails
@API(status=INTERNAL) public Relationship.Details getDetails()
The details contains the types, properties and cardinality.- Returns:
- A wrapper around the details of this relationship.
-
named
public Relationship named(java.lang.String newSymbolicName)
Creates a copy of this relationship with a new symbolic name.- Specified by:
namedin interfaceRelationshipPattern- Parameters:
newSymbolicName- the new symbolic name.- Returns:
- The new relationship.
-
named
public Relationship named(SymbolicName newSymbolicName)
Creates a copy of this relationship with a new symbolic name.- Parameters:
newSymbolicName- the new symbolic name.- Returns:
- The new relationship.
-
unbounded
public Relationship unbounded()
Creates a new relationship with an unbound length minimum length- Returns:
- the new relationship
- Since:
- 1.1.1
-
min
public Relationship min(java.lang.Integer minimum)
Creates a new relationship with a new minimum length- Parameters:
minimum- the new minimum- Returns:
- the new relationship
-
max
public Relationship max(java.lang.Integer maximum)
Creates a new relationship with a new maximum length- Parameters:
maximum- the new maximum- Returns:
- the new relationship
-
length
public Relationship length(java.lang.Integer minimum, java.lang.Integer maximum)
Creates a new relationship with a new length- Parameters:
minimum- the new minimummaximum- the new maximum- Returns:
- the new relationship
-
withProperties
public Relationship withProperties(MapExpression newProperties)
Description copied from interface:ExposesPropertiesCreates a a copy of this property container with additional properties. Creates a property container without properties when no properties are passed to this method.- Specified by:
withPropertiesin interfaceExposesProperties<Relationship>- Parameters:
newProperties- the new properties (can be null to remove exiting properties).- Returns:
- The new property container.
-
withProperties
public Relationship withProperties(java.lang.Object... keysAndValues)
Description copied from interface:ExposesPropertiesCreates a a copy of this property container with additional properties. Creates a property container without properties when no properties are passed to this method.- Specified by:
withPropertiesin interfaceExposesProperties<Relationship>- Parameters:
keysAndValues- A list of key and values. Must be an even number, with alternatingStringandExpression.- Returns:
- The new property container.
-
getSymbolicName
public java.util.Optional<SymbolicName> getSymbolicName()
- Specified by:
getSymbolicNamein interfaceNamed- Returns:
- An optional symbolic name.
-
getRequiredSymbolicName
public SymbolicName getRequiredSymbolicName()
- Specified by:
getRequiredSymbolicNamein interfaceNamed- Returns:
- A symbolic name
-
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
-
-