fromString static method

RelOperator fromString(
  1. String op
)

Converts a string operator representation to the corresponding enum value.

Parameters:

  • op: String representation of the operator ("==", "!=", "<", ">", "<=", ">=")

Returns: The corresponding RelOperator enum value

Throws:

  • Exception if the operator string is not recognized

Implementation

static RelOperator fromString(String op) {
  switch (op) {
    case "==":
      return RelOperator.eq;
    case "!=":
      return RelOperator.ne;
    case "<":
      return RelOperator.lt;
    case ">":
      return RelOperator.gt;
    case "<=":
      return RelOperator.le;
    case ">=":
      return RelOperator.ge;
    default:
      throw Exception("Unknown operator: $op");
  }
}