@Test void nestedQueryRules() { QueryRule rule1 = mock(QueryRule.class); when(rule1.getOperator()).thenReturn(IN); when(rule1.getNestedRules()).thenReturn(Collections.emptyList()); QueryRule rule2 = mock(QueryRule.class); when(rule2.getOperator()).thenReturn(DIS_MAX); when(rule2.getNestedRules()).thenReturn(Collections.emptyList()); QueryRule rule3 = mock(QueryRule.class); when(rule3.getNestedRules()).thenReturn(Collections.emptyList()); List<QueryRule> queryRules = Lists.newArrayList(rule1, rule2, rule3); when(query.getRules()).thenReturn(queryRules); QueryRule nestedRule = mock(QueryRule.class); when(nestedRule.getOperator()).thenReturn(EQUALS); when(rule3.getNestedRules()).thenReturn(Lists.newArrayList(nestedRule)); assertTrue(QueryUtils.containsOperator(query, EQUALS)); }
public static boolean containsOperator(Query<Entity> q, Operator operator) { return containsAnyOperator(q, EnumSet.of(operator)); }
QueryUtils { public static boolean containsOperator(Query<Entity> q, Operator operator) { return containsAnyOperator(q, EnumSet.of(operator)); } }
QueryUtils { public static boolean containsOperator(Query<Entity> q, Operator operator) { return containsAnyOperator(q, EnumSet.of(operator)); } private  QueryUtils(); }
QueryUtils { public static boolean containsOperator(Query<Entity> q, Operator operator) { return containsAnyOperator(q, EnumSet.of(operator)); } private  QueryUtils(); static boolean containsOperator(Query<Entity> q, Operator operator); static boolean containsAnyOperator(Query<Entity> q, Set<Operator> operators); static boolean containsAnyOperator(List<QueryRule> rules, Set<Operator> operators); static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType); static boolean containsComputedAttribute(Sort sort, EntityType entityType); static boolean containsComputedAttribute(
      Iterable<QueryRule> rules, EntityType entityType); static boolean containsNestedQueryRuleField(Query<Entity> q); static Attribute getQueryRuleAttribute(QueryRule queryRule, EntityType entityType); static List<Attribute> getAttributePath(String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType, boolean expandLabelInsteadOfId); static boolean isTaggedType(Attribute attribute, IRI typeIRI); }
QueryUtils { public static boolean containsOperator(Query<Entity> q, Operator operator) { return containsAnyOperator(q, EnumSet.of(operator)); } private  QueryUtils(); static boolean containsOperator(Query<Entity> q, Operator operator); static boolean containsAnyOperator(Query<Entity> q, Set<Operator> operators); static boolean containsAnyOperator(List<QueryRule> rules, Set<Operator> operators); static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType); static boolean containsComputedAttribute(Sort sort, EntityType entityType); static boolean containsComputedAttribute(
      Iterable<QueryRule> rules, EntityType entityType); static boolean containsNestedQueryRuleField(Query<Entity> q); static Attribute getQueryRuleAttribute(QueryRule queryRule, EntityType entityType); static List<Attribute> getAttributePath(String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType, boolean expandLabelInsteadOfId); static boolean isTaggedType(Attribute attribute, IRI typeIRI);  }