Class Labels

java.lang.Object
org.neo4j.cypherdsl.core.Labels
All Implemented Interfaces:
Visitable

public final class Labels extends Object implements Visitable
Represents label expressions, that can be in some way combined and may contain dynamic expressions as described here. Labels are essentially modelled as tree, so that they can be properly rendered.
We are using the term Labels here in accordance with GQL, in which a Label is a quality for both a node and a relationship element.
Since:
2025.1.0
Author:
Michael J. Simons
  • Method Details

    • colonConjunction

      public static Labels colonConjunction(Collection<Labels.Value> values)
      Creates a colon conjunction of all values.
      Parameters:
      values - the values for the conjunction
      Returns:
      a new labels expression
    • and

      public Labels and(Labels next)
      Create a conjunction.
      Parameters:
      next - the expression to add
      Returns:
      a new expression
    • or

      public Labels or(Labels next)
      Create a disjunction.
      Parameters:
      next - the expression to add
      Returns:
      a new expression
    • negate

      public Labels negate()
      Negates this expression.
      Returns:
      a new expression
    • conjunctionWith

      public Labels conjunctionWith(Labels other)
      Creates a colon based conjunction.
      Parameters:
      other - the other labels to create a conjunction with
      Returns:
      a new labels expression
    • disjunctionWith

      public Labels disjunctionWith(Labels other)
    • getLhs

      public Labels getLhs()
      Returns the optional left hand side of this node.
      Returns:
      the optional left hand side of this node
    • isNegated

      public boolean isNegated()
      Returns true if this is a negated expression.
      Returns:
      true if this is a negated expression
    • getRhs

      public Labels getRhs()
      Returns the optional right hand side of this node.
      Returns:
      the optional right hand side of this node
    • getType

      public Labels.Type getType()
    • getValue

      public List<Labels.Value> getValue()
    • getStaticValues

      public Collection<String> getStaticValues()
      Returns the list of all static labels.
      Returns:
      the list of all static labels
    • isEmpty

      public boolean isEmpty()