Class SingleComparisonNode

java.lang.Object
org.eclipse.ditto.rql.model.predicates.ast.SingleComparisonNode
All Implemented Interfaces:
Node

public final class SingleComparisonNode extends Object
Implements a comparison node like EQ (equals). A comparison node has a name, a property to compare on and a single value to compare for.
  • Constructor Details

    • SingleComparisonNode

      public SingleComparisonNode(SingleComparisonNode.Type comparisonType, String comparisonProperty, @Nullable Object comparisonValue)
      Constructor. Creates a new comparison node with the given type, property and value.
      Parameters:
      comparisonType - the type of the comparison.
      comparisonProperty - the property to compare on.
      comparisonValue - the value to compare for.
  • Method Details

    • accept

      public void accept(PredicateVisitor predicateVisitor)
      PredicateVisitor Pattern. Takes a visitor as parameter and calls the corresponding visit method with itself as parameter.
      Specified by:
      accept in interface Node
      Parameters:
      predicateVisitor - the visitor which should be called.
    • getComparisonType

      public SingleComparisonNode.Type getComparisonType()
      Retrieve the type of the comparison.
      Returns:
      the type of the comparison.
    • getComparisonProperty

      public String getComparisonProperty()
      Retrieve the property to compare on.
      Returns:
      the property to compare on.
    • getComparisonValue

      @Nullable public Object getComparisonValue()
      Retrieve the value to compare for.
      Returns:
      the value to compare for.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object