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, IdentifiableElement
A symbolic name to identify nodes, relationships and aliased items.

See SchemaName SymbolicName

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 Details

    • 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 concatenating otherValue to this names value. Returns this if otherValue is 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 to project(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 String in entries followed by an Expression will be treated as map keys pointing to the expression in the projection, String entries 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
    • toString

      public String toString()
      Description copied from interface: Visitable
      Most visitables will render themselves into a Cypher fragment preceded with the actual classname. The representation however is not cached - in contrast to the ones for full statements. Using toString is recommended for debugging purposes mainly, and not for production use.

      The concrete classname has been prepended to help debugging and actually to discourage using fragments to build queries without explicitly rendering them, either as statement or going through the renderer on purpose.

      Specified by:
      toString in interface Visitable
      Overrides:
      toString in class Object
      Returns:
      A string representation of this visitable formatted as Classname{cypher=value}
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • asExpression

      @NotNull public @NotNull Expression asExpression()
      Description copied from interface: IdentifiableElement
      Transform this element into an expression
      Specified by:
      asExpression in interface IdentifiableElement
      Returns:
      this element as an expression. Will return the same instance if it is already an expression.