- All Superinterfaces:
PropertyAccessor,Visitable
- All Known Subinterfaces:
Case,Case.CaseEnding,Case.GenericCase,Case.SimpleCase,Condition,Literal<T>,Property,SubqueryExpression
- All Known Implementing Classes:
AliasedExpression,Asterisk,BooleanLiteral,CollectExpression,Comparison,ConstantCondition,CountExpression,ExistentialSubquery,FunctionInvocation,HasLabelCondition,KeyValueMapEntry,ListComprehension,ListExpression,ListLiteral,ListOperator,MapExpression,MapLiteral,MapProjection,NestedExpression,NullLiteral,NumberLiteral,Operation,Parameter,PatternComprehension,PropertyLookup,StringLiteral,SymbolicName,TemporalLiteral
An expression can be used in many places, i.e. in return statements, pattern elements
etc.
- Since:
- 1.0
- Author:
- Michael J. Simons, Aakash Sorathiya
-
Method Summary
Modifier and TypeMethodDescriptiondefault Operationadd(Expression addend) Creates a+operation of this (the augend) and theaddend.default AliasedExpressionCreates an expression with an alias.default AliasedExpressionas(SymbolicName alias) Reuse an existing symbolic name to alias this expression.default SortItemThe property does not track the sort items created here.default ConditionTransform this expression into a condition.default Operationconcat(Expression expression) Creates an expression concatenating two string or list expressions.default Conditioncontains(Expression expression) Creates a condition that checks whether thisexpressioncontains thatexpression.default SortItemThe property does not track the sort items created here.default Operationdivide(Expression dividend) Creates a/operation of this (the divisor) and thedividend.default ConditionendsWith(Expression expression) Creates a condition that checks whether thisexpressionends with thatexpression.default Conditioneq(Expression rhs) An alias forisEqualTo(Expression).default Conditiongt(Expression rhs) Creates alhs > rhscondition.default Conditiongte(Expression rhs) Creates alhs >= rhscondition.default ConditionhasSize(Expression expectedSize) Takes thesize()expresssions and compares it for equality with the parameterexpectedSize.default Conditionin(Expression haystack) Creates aINoperation for this expression and thatexpression.default ConditionincludesAll(Expression rhs) Creates a condition that checks whether thisexpressionincludes all elements ofrhs.default ConditionincludesAny(Expression rhs) Creates a condition that checks whether thisexpressionincludes any element ofrhs.default ConditionisEmpty()Creates a condition that evaluates to true if this expression is empty.default ConditionisEqualTo(Expression rhs) Creates alhs = rhscondition.default ConditionisFalse()Creates a condition that checks whether thisexpressionis false.default ConditionisNotEqualTo(Expression rhs) Creates alhs <> rhscondition.default ConditionCreates aIS NOT NULLoperation for thisexpression.default ConditionisNull()Creates aIS NULLoperation for thisexpression.default ConditionisTrue()Creates a condition that checks whether thisexpressionis true.default Conditionlt(Expression rhs) Creates alhs < rhscondition.default Conditionlte(Expression rhs) Creates alhs <= rhscondition.default ConditionCreates a condition that checks whether thisexpressionmatches the givenpattern.default Conditionmatches(Expression expression) Creates a condition that checks whether thisexpressionmatches thatexpression.default Operationmultiply(Expression multiplicand) Creates a*operation of this (the multiplier) and themultiplicand.default Conditionne(Expression rhs) An alias forisNotEqualTo(Expression).default Operationpow(Expression n) Returns the power of n of this value.default PropertyReturns a newPropertyassociated with this element.default Propertyproperty(Expression lookup) Creates a newPropertyassociated with this property container.default Operationremainder(Expression dividend) Returns the remainder of this value and thedividend.default Expressionsize()This creates a size(e) expression from this expression.default SortItemsorted(SortItem.Direction direction) Creates a new sort item with the given direction.default ConditionstartsWith(Expression expression) Creates a condition that checks whether thisexpressionstarts with thatexpression.default Operationsubtract(Expression subtrahend) Creates a-operation of this (the minuend) and thesubtrahend.Methods inherited from interface org.neo4j.cypherdsl.core.PropertyAccessor
property
-
Method Details
-
includesAll
Creates a condition that checks whether thisexpressionincludes all elements ofrhs.- Parameters:
rhs- the other collection to compare to, must evaluate into a list during runtime.- Returns:
- a new condition
- Since:
- 2022.7.0
-
includesAny
Creates a condition that checks whether thisexpressionincludes any element ofrhs.- Parameters:
rhs- the other collection to compare to, must evaluate into a list during runtime.- Returns:
- a new condition
- Since:
- 2022.7.0
-
as
Creates an expression with an alias. This expression does not track which or how many aliases have been created.- Parameters:
alias- the alias to use- Returns:
- an aliased expression.
-
size
This creates a size(e) expression from this expression. The Cypher output will semantically only be valid when this refers to a list (see size(list)) or when the expression is a string (see size() applied to string).Any other expression will produce Cypher that is either deprecated in Neo4j ≥ 4.4 or not supported at all.
- Returns:
- the size of this expression (Either the number of items in a list or the number of characters in a string expression).
- Since:
- 2022.1.0
-
hasSize
Takes thesize()expresssions and compares it for equality with the parameterexpectedSize. The same restrictions as withsize()apply.- Parameters:
expectedSize- the expected size- Returns:
- a condition
- Since:
- 2022.1.0
- See Also:
-
as
Reuse an existing symbolic name to alias this expression.- Parameters:
alias- a symbolic name- Returns:
- an aliased expression.
- Since:
- 2021.0.2
-
asCondition
Transform this expression into a condition.- Returns:
- this expression as a condition. Will return the same instance if it is already a condition.
- Since:
- 2021.2.2
-
isEqualTo
Creates alhs = rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
eq
An alias forisEqualTo(Expression).- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
isNotEqualTo
Creates alhs <> rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
ne
An alias forisNotEqualTo(Expression).- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
lt
Creates alhs < rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
lte
Creates alhs <= rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
gt
Creates alhs > rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
gte
Creates alhs >= rhscondition.- Parameters:
rhs- the right hand side of the condition- Returns:
- a new condition
-
isTrue
Creates a condition that checks whether thisexpressionis true.- Returns:
- a new condition
-
isFalse
Creates a condition that checks whether thisexpressionis false.- Returns:
- a new condition
-
matches
Creates a condition that checks whether thisexpressionmatches thatexpression.- Parameters:
expression- the expression to match against. Must evaluate into a string during runtime.- Returns:
- a new condition.
-
matches
Creates a condition that checks whether thisexpressionmatches the givenpattern.- Parameters:
pattern- the pattern to match- Returns:
- a new condition.
-
startsWith
Creates a condition that checks whether thisexpressionstarts with thatexpression.- Parameters:
expression- the expression to match against. Must evaluate into a string during runtime.- Returns:
- a new condition.
-
contains
Creates a condition that checks whether thisexpressioncontains thatexpression.- Parameters:
expression- the expression to match against. Must evaluate into a string during runtime.- Returns:
- a new condition.
-
endsWith
Creates a condition that checks whether thisexpressionends with thatexpression.- Parameters:
expression- the expression to match against. Must evaluate into a string during runtime.- Returns:
- a new condition.
-
concat
Creates an expression concatenating two string or list expressions.- Parameters:
expression- the expression to concat to this expression.- Returns:
- a new expression.
-
add
Creates a+operation of this (the augend) and theaddend.- Parameters:
addend- the addend- Returns:
- a new operation.
- Since:
- 1.0.1
-
subtract
Creates a-operation of this (the minuend) and thesubtrahend.- Parameters:
subtrahend- the subtrahend- Returns:
- a new operation.
- Since:
- 1.0.1
-
multiply
Creates a*operation of this (the multiplier) and themultiplicand.- Parameters:
multiplicand- the multiplicand- Returns:
- a new operation.
- Since:
- 1.0.1
-
divide
Creates a/operation of this (the divisor) and thedividend.- Parameters:
dividend- the dividend- Returns:
- a new operation.
- Since:
- 1.0.1
-
remainder
Returns the remainder of this value and thedividend.- Parameters:
dividend- the dividend- Returns:
- a new operation.
-
pow
Returns the power of n of this value.- Parameters:
n- power to raise thisExpressionto.- Returns:
- a new operation.
-
isNull
Creates aIS NULLoperation for thisexpression. The expression does not track the condition created here.- Returns:
- a condition based on this expression that evaluates to true when this expression is null.
-
isNotNull
Creates aIS NOT NULLoperation for thisexpression. The expression does not track the condition created here.- Returns:
- a condition based on this expression that evaluates to true when this expression is not null.
-
in
Creates aINoperation for this expression and thatexpression. The expression does not track the condition created here.- Parameters:
haystack- the expression to search for this expression- Returns:
- a new condition.
-
isEmpty
Creates a condition that evaluates to true if this expression is empty.- Returns:
- a new condition.
-
descending
The property does not track the sort items created here.- Returns:
- a sort item for this property in descending order
-
ascending
The property does not track the sort items created here.- Returns:
- a sort item for this property in ascending order
-
sorted
Creates a new sort item with the given direction.- Parameters:
direction- the direction to sort- Returns:
- a new sort item.
- Since:
- 2021.4.1
-
property
Description copied from interface:PropertyAccessorReturns a newPropertyassociated with this element.- Specified by:
propertyin interfacePropertyAccessor- Parameters:
names- a list of nested property names- Returns:
- a new
Propertyassociated with this element - See Also:
-
property
Creates a newPropertyassociated with this property container. This property can be used as a lookup in other expressions. It does not add a value to the property.The new
Propertyobject is a dynamic lookup, based on theexpressionpassed to this method. The expression can be example another property, a function result or a Cypher parameter. A property defined in such a way will render asp[expression].Note: The property container does not track property creation and there is no possibility to enumerate all properties that have been created for this property container.
- Specified by:
propertyin interfacePropertyAccessor- Parameters:
lookup- the expression that is evaluated to lookup this property.- Returns:
- a new
Propertyassociated with this named container - Since:
- 2024.1.0
-