Package org.neo4j.cypherdsl.core
Class Node
- java.lang.Object
-
- org.neo4j.cypherdsl.core.Node
-
- All Implemented Interfaces:
ExposesProperties<Node>,ExposesRelationships<Relationship>,Named,PatternElement,PropertyContainer,Visitable
@API(status=EXPERIMENTAL, since="1.0") public final class Node extends java.lang.Object implements PatternElement, PropertyContainer, ExposesRelationships<Relationship>, ExposesProperties<Node>See NodePattern.- Since:
- 1.0
- Author:
- Michael J. Simons
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)AliasedExpressionas(java.lang.String alias)Creates an alias for this node.SortItemascending()Creates a new sort item of this node in ascending order.SortItemdescending()Creates a new sort item of this node in descending order.SymbolicNamegetRequiredSymbolicName()java.util.Optional<SymbolicName>getSymbolicName()ConditionhasLabels(java.lang.String... labelsToQuery)A condition that checks for the presence of labels on a node.FunctionInvocationinternalId()ConditionisEqualTo(Node otherNode)Creates a new condition whether this node is equal to otherNode.ConditionisNotEqualTo(Node otherNode)Creates a new condition whether this node is not equal to otherNode.ConditionisNotNull()Creates a new condition based on this node whether it is not null.ConditionisNull()Creates a new condition based on this node whether it is null.FunctionInvocationlabels()Nodenamed(java.lang.String newSymbolicName)Creates a copy of this node with a new symbolic name.Nodenamed(SymbolicName newSymbolicName)Creates a copy of this node with a new symbolic name.RelationshiprelationshipBetween(Node other, java.lang.String... types)Starts building an undirected relationship between thisnodeand theother.RelationshiprelationshipFrom(Node other, java.lang.String... types)Starts building an incoming relationship starting at theothernode.RelationshiprelationshipTo(Node other, java.lang.String... types)Starts building an outgoing relationship to theothernode.java.lang.StringtoString()NodewithProperties(java.lang.Object... keysAndValues)Creates a a copy of this property container with additional properties.NodewithProperties(MapExpression newProperties)Creates a a copy of this property container with additional properties.
-
-
-
Method Detail
-
named
public Node named(java.lang.String newSymbolicName)
Creates a copy of this node with a new symbolic name.- Parameters:
newSymbolicName- the new symbolic name.- Returns:
- The new node.
-
named
public Node named(SymbolicName newSymbolicName)
Creates a copy of this node with a new symbolic name.- Parameters:
newSymbolicName- the new symbolic name.- Returns:
- The new node.
-
withProperties
public Node 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<Node>- Parameters:
newProperties- the new properties (can be null to remove exiting properties).- Returns:
- The new property container.
-
withProperties
public Node 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<Node>- 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:
- The optional symbolic name of this node.
-
getRequiredSymbolicName
public SymbolicName getRequiredSymbolicName()
- Specified by:
getRequiredSymbolicNamein interfaceNamed- Returns:
- A symbolic name
-
internalId
public FunctionInvocation internalId()
- Returns:
- A new function invocation returning the internal id of this node.
-
labels
public FunctionInvocation labels()
- Returns:
- A new function invocation returning the labels of this node.
-
relationshipTo
public Relationship relationshipTo(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an outgoing relationship to theothernode.- Specified by:
relationshipToin interfaceExposesRelationships<Relationship>- 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 Relationship relationshipFrom(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an incoming relationship starting at theothernode.- Specified by:
relationshipFromin interfaceExposesRelationships<Relationship>- 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 Relationship relationshipBetween(Node other, java.lang.String... types)
Description copied from interface:ExposesRelationshipsStarts building an undirected relationship between thisnodeand theother.- Specified by:
relationshipBetweenin interfaceExposesRelationships<Relationship>- 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
-
hasLabels
public Condition hasLabels(java.lang.String... labelsToQuery)
A condition that checks for the presence of labels on a node.- Parameters:
labelsToQuery- A list of labels to query- Returns:
- A condition that checks whether this node has all of the labels to query
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isEqualTo
public Condition isEqualTo(Node otherNode)
Creates a new condition whether this node is equal to otherNode.- Parameters:
otherNode- The node to compare this node to.- Returns:
- A condition.
-
isNotEqualTo
public Condition isNotEqualTo(Node otherNode)
Creates a new condition whether this node is not equal to otherNode.- Parameters:
otherNode- The node to compare this node to.- Returns:
- A condition.
-
isNull
public Condition isNull()
Creates a new condition based on this node whether it is null.- Returns:
- A condition.
-
isNotNull
public Condition isNotNull()
Creates a new condition based on this node whether it is not null.- Returns:
- A condition.
-
descending
public SortItem descending()
Creates a new sort item of this node in descending order.- Returns:
- A sort item.
-
ascending
public SortItem ascending()
Creates a new sort item of this node in ascending order.- Returns:
- A sort item.
-
as
public AliasedExpression as(java.lang.String alias)
Creates an alias for this node.- Parameters:
alias- The alias to use.- Returns:
- The aliased expression.
-
-