@Test public void testParseWithExtendedNamesShouldPass() { SimpleConstraintParser parser = new SimpleConstraintParser(); check(parser.parse("analytics_time LT 1"), "analytics_time", Operator.LT, "1"); check(parser.parse("nuro.analytics LT 1"), "nuro.analytics", Operator.LT, "1"); check(parser.parse("nuro.analytics_time LT 1"), "nuro.analytics_time", Operator.LT, "1"); check(parser.parse("a.b.c LT 1"), "a.b.c", Operator.LT, "1"); }
public SimpleConstraintParser.SimpleConstraintElements parse(String constraint) { SimpleConstraintParser.SimpleConstraintElements result; Matcher m = re.matcher(constraint); try { if (m.matches()) { Operator op = Operator.valueOf(m.group(2)); String right = getRightOperandGroup(m); result = new SimpleConstraintParser.SimpleConstraintElements( m.group(1), op, right); return result; } } catch (Exception e) { } throw new IllegalArgumentException("[" + constraint + "] is not a valid constraint"); }
SimpleConstraintParser { public SimpleConstraintParser.SimpleConstraintElements parse(String constraint) { SimpleConstraintParser.SimpleConstraintElements result; Matcher m = re.matcher(constraint); try { if (m.matches()) { Operator op = Operator.valueOf(m.group(2)); String right = getRightOperandGroup(m); result = new SimpleConstraintParser.SimpleConstraintElements( m.group(1), op, right); return result; } } catch (Exception e) { } throw new IllegalArgumentException("[" + constraint + "] is not a valid constraint"); } }
SimpleConstraintParser { public SimpleConstraintParser.SimpleConstraintElements parse(String constraint) { SimpleConstraintParser.SimpleConstraintElements result; Matcher m = re.matcher(constraint); try { if (m.matches()) { Operator op = Operator.valueOf(m.group(2)); String right = getRightOperandGroup(m); result = new SimpleConstraintParser.SimpleConstraintElements( m.group(1), op, right); return result; } } catch (Exception e) { } throw new IllegalArgumentException("[" + constraint + "] is not a valid constraint"); }  }
SimpleConstraintParser { public SimpleConstraintParser.SimpleConstraintElements parse(String constraint) { SimpleConstraintParser.SimpleConstraintElements result; Matcher m = re.matcher(constraint); try { if (m.matches()) { Operator op = Operator.valueOf(m.group(2)); String right = getRightOperandGroup(m); result = new SimpleConstraintParser.SimpleConstraintElements( m.group(1), op, right); return result; } } catch (Exception e) { } throw new IllegalArgumentException("[" + constraint + "] is not a valid constraint"); }  SimpleConstraintParser.SimpleConstraintElements parse(String constraint); }
SimpleConstraintParser { public SimpleConstraintParser.SimpleConstraintElements parse(String constraint) { SimpleConstraintParser.SimpleConstraintElements result; Matcher m = re.matcher(constraint); try { if (m.matches()) { Operator op = Operator.valueOf(m.group(2)); String right = getRightOperandGroup(m); result = new SimpleConstraintParser.SimpleConstraintElements( m.group(1), op, right); return result; } } catch (Exception e) { } throw new IllegalArgumentException("[" + constraint + "] is not a valid constraint"); }  SimpleConstraintParser.SimpleConstraintElements parse(String constraint);  }