Class SymbolicName

  • All Implemented Interfaces:
    Expression, Visitable

    @API(status=EXPERIMENTAL,
         since="1.0")
    public class SymbolicName
    extends java.lang.Object
    implements Expression
    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 Detail

      • getValue

        @API(status=INTERNAL)
        public java.lang.String getValue()
        Returns:
        The value of this symbolic name.
      • concat

        public SymbolicName concat​(java.lang.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
      • asCondition

        public Condition asCondition()
        Transform this symbolic name so it can be used directly as condition.
        Returns:
        this name as a condition
        Since:
        2021.0.0
      • project

        public MapProjection project​(java.util.List<java.lang.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

        public MapProjection project​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object