- All Superinterfaces:
Visitable
- All Known Subinterfaces:
Case,Case.CaseEnding,Case.GenericCase,Case.SimpleCase,Condition,Literal<T>,Property,SubqueryExpression
- All Known Implementing Classes:
AliasedExpression,Asterisk,BooleanLiteral,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 @NotNull Operationadd(Expression addend) Creates a+operation of this (the augend) and theaddend.default @NotNull AliasedExpressionCreates an expression with an alias.default @NotNull AliasedExpressionas(SymbolicName alias) Reuse an existing symbolic name to alias this expressiondefault @NotNull SortItemThe property does not track the sort items created here.default @NotNull ConditionTransform this expression into a condition.default @NotNull Operationconcat(Expression expression) Creates an expression concatenating two string or list expressions.default @NotNull Conditioncontains(Expression expression) Creates a condition that checks whether thisexpressioncontains thatexpression.default @NotNull SortItemThe property does not track the sort items created here.default @NotNull Operationdivide(Expression dividend) Creates a/operation of this (the divisor) and thedividend.default @NotNull ConditionendsWith(Expression expression) Creates a condition that checks whether thisexpressionends with thatexpression.default @NotNull Conditioneq(Expression rhs) An alias forisEqualTo(Expression).default @NotNull Conditiongt(Expression rhs) Creates alhs > rhscondition.default @NotNull Conditiongte(Expression rhs) Creates alhs >= rhscondition.default @NotNull ConditionhasSize(Expression expectedSize) Takes thesize()expresssions and compares it for equality with the parameterexpectedSize.default @NotNull Conditionin(Expression haystack) Creates aINoperation for this expression and thatexpression.default @NotNull ConditionincludesAll(Expression rhs) Creates a condition that checks whether thisexpressionincludes all elements ofrhs.default @NotNull ConditionincludesAny(Expression rhs) Creates a condition that checks whether thisexpressionincludes any element ofrhs.default @NotNull ConditionisEmpty()Creates a condition that evaluates to true if this expression is empty.default @NotNull ConditionisEqualTo(Expression rhs) Creates alhs = rhscondition.default @NotNull ConditionisFalse()Creates a condition that checks whether thisexpressionis false.default @NotNull ConditionisNotEqualTo(Expression rhs) Creates alhs <> rhscondition.default @NotNull ConditionCreates aIS NOT NULLoperation for thisexpression.default @NotNull ConditionisNull()Creates aIS NULLoperation for thisexpression.default @NotNull ConditionisTrue()Creates a condition that checks whether thisexpressionis true.default @NotNull Conditionlt(Expression rhs) Creates alhs < rhscondition.default @NotNull Conditionlte(Expression rhs) Creates alhs <= rhscondition.default @NotNull ConditionCreates a condition that checks whether thisexpressionmatches the givenpattern.default @NotNull Conditionmatches(Expression expression) Creates a condition that checks whether thisexpressionmatches thatexpression.default @NotNull Operationmultiply(Expression multiplicand) Creates a*operation of this (the multiplier) and themultiplicand.default @NotNull Conditionne(Expression rhs) An alias forisNotEqualTo(Expression).default @NotNull Operationpow(Expression n) Returns the power of n of this value.default @NotNull PropertyAssumes that this expressions refers to a container of some type allowing to reference properties from it.default @NotNull Operationremainder(Expression dividend) Returns the remainder of this value and thedividend.default @NotNull Expressionsize()This creates a size(e) expression from this expression.default @NotNull SortItemsorted(SortItem.Direction direction) Creates a new sort item with the given direction.default @NotNull ConditionstartsWith(Expression expression) Creates a condition that checks whether thisexpressionstarts with thatexpression.default @NotNull Operationsubtract(Expression subtrahend) Creates a-operation of this (the minuend) and thesubtrahend.
-
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
Assumes that this expressions refers to a container of some type allowing to reference properties from it. Note: The expression does not track property creation and there is no possibility to enumerate all properties that have been created for it.- Parameters:
names- At least one non empty name. If multiple names are specified, the expression creates a nested property likethis.name1.name2.- Returns:
- a new
Propertyassociated with this expression - Since:
- 2021.0.0
-