Record Class LogicCondition

java.lang.Object
java.lang.Record
org.litebridge.db.spi.query.LogicCondition
Record Components:
logicOperator - The logical operator used to combine this condition with the previous one.
condition - The condition itself.

public record LogicCondition(LogicOperator logicOperator, Condition condition) extends Record
Logically combined condition.
  • Constructor Details

    • LogicCondition

      public LogicCondition(SelectExpression lhs, Operator operator, @Nullable Object value)
      Constructs a logical condition with the specified left-hand side (LHS) expression, operator, and value.

      This constructor automatically creates a Condition with the provided parameters and uses the NOOP logical operator to signify that this condition is not combined with a previous one.

      Parameters:
      lhs - The left-hand side expression of the condition.
      operator - The operator used to compare or relate the LHS to the value.
      value - The value or operand to be compared with the LHS. This can be null for certain operators like IS_NULL and IS_NOT_NULL.
    • LogicCondition

      public LogicCondition(LogicOperator logicOperator, Condition condition)
      Creates an instance of a LogicCondition record class.
      Parameters:
      logicOperator - the value for the logicOperator record component
      condition - the value for the condition record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • logicOperator

      public LogicOperator logicOperator()
      Returns the value of the logicOperator record component.
      Returns:
      the value of the logicOperator record component
    • condition

      public Condition condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component