@Test void equalsWithNestedRules() { QueryRule q = new QueryRule(); assertNotNull(q.getNestedRules()); assertTrue(q.getNestedRules().isEmpty()); QueryRule nested = new QueryRule("field", EQUALS, "Test"); q = new QueryRule(Operator.NOT, new QueryRule(nested)); assertEquals(1, q.getNestedRules().size()); assertEquals(q.getNestedRules().get(0), nested); }
public List<QueryRule> getNestedRules() { if (nestedRules == null) { return Collections.emptyList(); } return nestedRules; }
QueryRule { public List<QueryRule> getNestedRules() { if (nestedRules == null) { return Collections.emptyList(); } return nestedRules; } }
QueryRule { public List<QueryRule> getNestedRules() { if (nestedRules == null) { return Collections.emptyList(); } return nestedRules; } QueryRule();  QueryRule(List<QueryRule> nestedRules);  QueryRule(QueryRule copy);  QueryRule(String field, Operator operator, Object value); @SuppressWarnings("unchecked")  QueryRule(Operator operator, Object value);  QueryRule(Operator operator, QueryRule nestedRules);  QueryRule(Operator operator);  QueryRule(String field, Operator equals, String value); }
QueryRule { public List<QueryRule> getNestedRules() { if (nestedRules == null) { return Collections.emptyList(); } return nestedRules; } QueryRule();  QueryRule(List<QueryRule> nestedRules);  QueryRule(QueryRule copy);  QueryRule(String field, Operator operator, Object value); @SuppressWarnings("unchecked")  QueryRule(Operator operator, Object value);  QueryRule(Operator operator, QueryRule nestedRules);  QueryRule(Operator operator);  QueryRule(String field, Operator equals, String value); String getField(); void setField(String field); Operator getOperator(); void setOperator(Operator operator); Object getValue(); void setValue(Object value); List<QueryRule> getNestedRules(); @Override String toString(); static QueryRule eq(String name, Object value); @Override boolean equals(Object o); @Override int hashCode(); }
QueryRule { public List<QueryRule> getNestedRules() { if (nestedRules == null) { return Collections.emptyList(); } return nestedRules; } QueryRule();  QueryRule(List<QueryRule> nestedRules);  QueryRule(QueryRule copy);  QueryRule(String field, Operator operator, Object value); @SuppressWarnings("unchecked")  QueryRule(Operator operator, Object value);  QueryRule(Operator operator, QueryRule nestedRules);  QueryRule(Operator operator);  QueryRule(String field, Operator equals, String value); String getField(); void setField(String field); Operator getOperator(); void setOperator(Operator operator); Object getValue(); void setValue(Object value); List<QueryRule> getNestedRules(); @Override String toString(); static QueryRule eq(String name, Object value); @Override boolean equals(Object o); @Override int hashCode();  }