Package org.neo4j.cypherdsl.core
Class SymbolicName
- java.lang.Object
-
- org.neo4j.cypherdsl.core.SymbolicName
-
- All Implemented Interfaces:
Visitable,Expression,IdentifiableElement
@API(status=EXPERIMENTAL, since="1.0") public final class SymbolicName extends Object implements Expression, IdentifiableElementA symbolic name to identify nodes, relationships and aliased items.While OpenCypher extends the UNICODE IDENTIFIER AND PATTERN SYNTAX with some characters, this DSL uses the same identifier Java itself uses for simplicity and until otherwise needed.
- Since:
- 1.0
- Author:
- Michael J. Simons, Andreas Berger
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ExpressionasExpression()Transform this element into an expression@NotNull SymbolicNameconcat(String otherValue)Creates a new symbolic name by concatenatingotherValueto this names value.booleanequals(Object o)StringgetValue()inthashCode()@NotNull MapProjectionproject(Object... entries)Creates a map projection based on this node.@NotNull MapProjectionproject(List<Object> entries)A list will never be a valid entry for a map projection, so this convenient method prevents trying to create one from a list of objects.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.neo4j.cypherdsl.core.Expression
add, as, as, ascending, asCondition, concat, contains, descending, divide, endsWith, eq, gt, gte, in, isEmpty, isEqualTo, isFalse, isNotEqualTo, isNotNull, isNull, isTrue, lt, lte, matches, matches, multiply, ne, pow, property, remainder, sorted, startsWith, subtract
-
-
-
-
Method Detail
-
getValue
@API(status=INTERNAL) public String getValue()
- Returns:
- The value of this symbolic name.
-
concat
@NotNull @Contract(pure=true) public @NotNull SymbolicName concat(String otherValue)
Creates a new symbolic name by concatenatingotherValueto this names value. Returns this ifotherValueis empty.- Parameters:
otherValue- The value to concat.- Returns:
- A new symbolic name
-
project
@NotNull @Contract(pure=true) public @NotNull MapProjection project(List<Object> entries)
A list will never be a valid entry for a map projection, so this convenient method prevents trying to create one from a list of objects. It will delegate toproject(Object...)with the content of the list.- Parameters:
entries- A list of entries for the projection- Returns:
- A map projection.
- Since:
- 2021.0.0
-
project
@NotNull @Contract(pure=true) public @NotNull MapProjection project(Object... entries)
Creates a map projection based on this node. The node needs a symbolic name for this to work.Entries of type
Stringinentriesfollowed by anExpressionwill be treated as map keys pointing to the expression in the projection,Stringentries alone will be treated as property lookups on the node.- Parameters:
entries- A list of entries for the projection- Returns:
- A map projection.
- Since:
- 2021.0.0
-
asExpression
@NotNull public @NotNull Expression asExpression()
Description copied from interface:IdentifiableElementTransform this element into an expression- Specified by:
asExpressionin interfaceIdentifiableElement- Returns:
- this element as an expression. Will return the same instance if it is already an expression.
-
-