public static RelationalOperator createOperator(String operator) throws InvalidQueryException {
    if ("!=".equals(operator)) {
      return new NotEqualsOperator();
    } else if ("=".equals(operator)) {
      return new EqualsOperator();
    } else if ("<=".equals(operator)) {
      return new LessEqualsOperator();
    } else if ("<".equals(operator)) {
      return new LessOperator();
    } else if (">=".equals(operator)) {
      return new GreaterEqualsOperator();
    } else if (">".equals(operator)) {
      return new GreaterOperator();
    } else if (".in(".equals(operator)) {
      return new InOperator();
    } else if (".isEmpty(".equals(operator)) {
      return new IsEmptyOperator();
    } else if (".matches(".equals(operator)) {
      return new FilterOperator();
    } else {
      throw new RuntimeException("Invalid Operator Type: " + operator);
    }
  }
Create a relational operator based on the string representation
of the operator.

@param operator  the string representation of the operator

@return relational operator for the given string
@throws InvalidQueryException if an invalid operator is passed in
ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java