Package org.neo4j.cypherdsl.core
Interface Expression
-
- All Superinterfaces:
Visitable
- All Known Subinterfaces:
Case.CaseEnding
,Condition
,Literal<T>
,Property
- All Known Implementing Classes:
AliasedExpression
,Asterisk
,BooleanLiteral
,Case.GenericCase.EndingGenericCase
,Comparison
,CompoundCondition
,ConstantCondition
,ExistentialSubquery
,FunctionInvocation
,HasLabelCondition
,KeyValueMapEntry
,ListComprehension
,ListExpression
,ListLiteral
,ListOperator
,MapExpression
,MapProjection
,Namespace
,NestedExpression
,NullLiteral
,NumberLiteral
,Operation
,Parameter
,PatternComprehension
,PropertyLookup
,StringLiteral
,SymbolicName
,TemporalLiteral
@API(status=EXPERIMENTAL, since="1.0") public interface Expression extends Visitable
An expression can be used in many places, i.e. in return statements, pattern elements etc.- Since:
- 1.0
- Author:
- Michael J. Simons
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default @NotNull Operation
add(Expression addend)
Creates a+
operation of this (the augend) and theaddend
.default @NotNull AliasedExpression
as(java.lang.String alias)
Creates an expression with an alias.default @NotNull AliasedExpression
as(SymbolicName alias)
Reuse an existing symbolic name to alias this expressiondefault @NotNull SortItem
ascending()
The property does not track the sort items created here.default @NotNull Operation
concat(Expression expression)
Creates an expression concatenating two string or list expressions.default @NotNull Condition
contains(Expression expression)
Creates a condition that checks whether thisexpression
contains thatexpression
.default @NotNull SortItem
descending()
The property does not track the sort items created here.default @NotNull Operation
divide(Expression dividend)
Creates a/
operation of this (the divisor) and thedividend
.default @NotNull Condition
endsWith(Expression expression)
Creates a condition that checks whether thisexpression
ends with thatexpression
.default @NotNull Condition
eq(Expression rhs)
An alias forisEqualTo(Expression)
.default @NotNull Condition
gt(Expression rhs)
Creates alhs > rhs
condition.default @NotNull Condition
gte(Expression rhs)
Creates alhs >= rhs
condition.default @NotNull Condition
in(Expression haystack)
Creates aIN
operation for this expression and thatexpression
.default @NotNull Condition
isEmpty()
Creates a condition that evaluates to true if this expression is empty.default @NotNull Condition
isEqualTo(Expression rhs)
Creates alhs = rhs
condition.default @NotNull Condition
isFalse()
Creates a condition that checks whether thisexpression
is false.default @NotNull Condition
isNotEqualTo(Expression rhs)
Creates alhs <> rhs
condition.default @NotNull Condition
isNotNull()
Creates aIS NOT NULL
operation for thisexpression
.default @NotNull Condition
isNull()
Creates aIS NULL
operation for thisexpression
.default @NotNull Condition
isTrue()
Creates a condition that checks whether thisexpression
is true.default @NotNull Condition
lt(Expression rhs)
Creates alhs < rhs
condition.default @NotNull Condition
lte(Expression rhs)
Creates alhs <= rhs
condition.default @NotNull Condition
matches(java.lang.String pattern)
Creates a condition that checks whether thisexpression
matches the givenpattern
.default @NotNull Condition
matches(Expression expression)
Creates a condition that checks whether thisexpression
matches thatexpression
.default @NotNull Operation
multiply(Expression multiplicand)
Creates a*
operation of this (the multiplier) and themultiplicand
.default @NotNull Condition
ne(Expression rhs)
An alias forisNotEqualTo(Expression)
.default @NotNull Operation
pow(Expression n)
Returns the power of n of this value.default @NotNull Property
property(java.lang.String... names)
Assumes that this expressions refers to a container of some type allowing to reference properties from it.default @NotNull Operation
remainder(Expression dividend)
Returns the remainder of this value and thedividend
.default @NotNull Condition
startsWith(Expression expression)
Creates a condition that checks whether thisexpression
starts with thatexpression
.default @NotNull Operation
subtract(Expression subtrahend)
Creates a-
operation of this (the minuend) and thesubtrahend
.
-
-
-
Method Detail
-
as
@NotNull @Contract(pure=true) default @NotNull AliasedExpression as(java.lang.String alias)
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.
-
as
@NotNull @Contract(pure=true) default @NotNull AliasedExpression as(SymbolicName alias)
Reuse an existing symbolic name to alias this expression- Parameters:
alias
- A symbolic name- Returns:
- An aliased expression.
- Since:
- 2021.0.2
-
isEqualTo
@NotNull @Contract(pure=true) default @NotNull Condition isEqualTo(Expression rhs)
Creates alhs = rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
eq
@NotNull @Contract(pure=true) default @NotNull Condition eq(Expression rhs)
An alias forisEqualTo(Expression)
.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
isNotEqualTo
@NotNull @Contract(pure=true) default @NotNull Condition isNotEqualTo(Expression rhs)
Creates alhs <> rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
ne
@NotNull @Contract(pure=true) default @NotNull Condition ne(Expression rhs)
An alias forisNotEqualTo(Expression)
.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
lt
@NotNull @Contract(pure=true) default @NotNull Condition lt(Expression rhs)
Creates alhs < rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
lte
@NotNull @Contract(pure=true) default @NotNull Condition lte(Expression rhs)
Creates alhs <= rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
gt
@NotNull @Contract(pure=true) default @NotNull Condition gt(Expression rhs)
Creates alhs > rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
gte
@NotNull @Contract(pure=true) default @NotNull Condition gte(Expression rhs)
Creates alhs >= rhs
condition.- Parameters:
rhs
- The right hand side of the condition- Returns:
- A new condition
-
isTrue
@NotNull @Contract(pure=true) default @NotNull Condition isTrue()
Creates a condition that checks whether thisexpression
is true.- Returns:
- A new condition
-
isFalse
@NotNull @Contract(pure=true) default @NotNull Condition isFalse()
Creates a condition that checks whether thisexpression
is false.- Returns:
- A new condition
-
matches
@NotNull @Contract(pure=true) default @NotNull Condition matches(Expression expression)
Creates a condition that checks whether thisexpression
matches thatexpression
.- Parameters:
expression
- The expression to match against. Must evaluate into a string during runtime.- Returns:
- A new condition.
-
matches
@NotNull @Contract(pure=true) default @NotNull Condition matches(java.lang.String pattern)
Creates a condition that checks whether thisexpression
matches the givenpattern
.- Parameters:
pattern
- The pattern to match- Returns:
- A new condition.
-
startsWith
@NotNull @Contract(pure=true) default @NotNull Condition startsWith(Expression expression)
Creates a condition that checks whether thisexpression
starts with thatexpression
.- Parameters:
expression
- The expression to match against. Must evaluate into a string during runtime.- Returns:
- A new condition.
-
contains
@NotNull @Contract(pure=true) default @NotNull Condition contains(Expression expression)
Creates a condition that checks whether thisexpression
contains thatexpression
.- Parameters:
expression
- The expression to match against. Must evaluate into a string during runtime.- Returns:
- A new condition.
-
endsWith
@NotNull @Contract(pure=true) default @NotNull Condition endsWith(Expression expression)
Creates a condition that checks whether thisexpression
ends with thatexpression
.- Parameters:
expression
- The expression to match against. Must evaluate into a string during runtime.- Returns:
- A new condition.
-
concat
@NotNull @Contract(pure=true) default @NotNull Operation concat(Expression expression)
Creates an expression concatenating two string or list expressions.- Parameters:
expression
- The expression to concat to this expression.- Returns:
- A new expression.
-
add
@NotNull @Contract(pure=true) default @NotNull Operation add(Expression addend)
Creates a+
operation of this (the augend) and theaddend
.- Parameters:
addend
- The addend- Returns:
- A new operation.
- Since:
- 1.0.1
-
subtract
@NotNull @Contract(pure=true) default @NotNull Operation subtract(Expression subtrahend)
Creates a-
operation of this (the minuend) and thesubtrahend
.- Parameters:
subtrahend
- The subtrahend- Returns:
- A new operation.
- Since:
- 1.0.1
-
multiply
@NotNull @Contract(pure=true) default @NotNull Operation multiply(Expression multiplicand)
Creates a*
operation of this (the multiplier) and themultiplicand
.- Parameters:
multiplicand
- The multiplicand- Returns:
- A new operation.
- Since:
- 1.0.1
-
divide
@NotNull @Contract(pure=true) default @NotNull Operation divide(Expression dividend)
Creates a/
operation of this (the divisor) and thedividend
.- Parameters:
dividend
- The dividend- Returns:
- A new operation.
- Since:
- 1.0.1
-
remainder
@NotNull @Contract(pure=true) default @NotNull Operation remainder(Expression dividend)
Returns the remainder of this value and thedividend
.- Parameters:
dividend
- The dividend- Returns:
- A new operation.
-
pow
@NotNull @Contract(pure=true) default @NotNull Operation pow(Expression n)
Returns the power of n of this value.- Parameters:
n
- power to raise thisExpression
to.- Returns:
- A new operation.
-
isNull
@NotNull @Contract(pure=true) default @NotNull Condition isNull()
Creates aIS NULL
operation 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
@NotNull @Contract(pure=true) default @NotNull Condition isNotNull()
Creates aIS NOT NULL
operation 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
@NotNull @Contract(pure=true) default @NotNull Condition in(Expression haystack)
Creates aIN
operation 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
@NotNull @Contract(pure=true) default @NotNull Condition isEmpty()
Creates a condition that evaluates to true if this expression is empty.- Returns:
- A new condition.
-
descending
@NotNull @Contract(pure=true) default @NotNull SortItem descending()
The property does not track the sort items created here.- Returns:
- A sort item for this property in descending order
-
ascending
@NotNull @Contract(pure=true) default @NotNull SortItem ascending()
The property does not track the sort items created here.- Returns:
- A sort item for this property in ascending order
-
property
@NotNull @Contract(pure=true) default @NotNull Property property(java.lang.String... names)
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
Property
associated with this expression - Since:
- 2021.0.0
-
-