Class MultiComparisonNode

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

public final class MultiComparisonNode extends Object
Implements a comparison node like IN (in array). A comparison node has a name, a property to compare on and a array of values to compare for.
  • Constructor Details

    • MultiComparisonNode

      public MultiComparisonNode(MultiComparisonNode.Type comparisonType, String comparisonProperty)
      Constructor. Creates a new comparison node with the given type, property and list of values.
      Parameters:
      comparisonType - the type of the comparison.
      comparisonProperty - the property to compare on.
    • MultiComparisonNode

      public MultiComparisonNode(MultiComparisonNode.Type comparisonType, String comparisonProperty, List<Object> comparisonPropertyValues)
      Constructor. Creates a new comparison node with the given type, property and list of values.
      Parameters:
      comparisonType - the type of the comparison.
      comparisonProperty - the property to compare on.
      comparisonPropertyValues - the property to compare on.
  • Method Details

    • addValue

      public void addValue(Object value)
      Add the given value to the list of values.
      Parameters:
      value - the value to add.
    • 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 MultiComparisonNode.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 List<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