@Test void containsComputedAttributeNested() { String refAttrName = "refAttr"; String attrName = "attr"; String queryRuleField = refAttrName + '.' + attrName; QueryRule queryRule = mock(QueryRule.class); when(queryRule.getField()).thenReturn(queryRuleField); EntityType entityType = mock(EntityType.class); Attribute refAttr = mock(Attribute.class); EntityType refEntity = mock(EntityType.class); Attribute attr = mock(Attribute.class); when(attr.hasExpression()).thenReturn(true); when(refEntity.getAttribute(attrName)).thenReturn(attr); when(refAttr.getRefEntity()).thenReturn(refEntity); when(entityType.getAttribute(refAttrName)).thenReturn(refAttr); assertTrue(QueryUtils.containsComputedAttribute(singletonList(queryRule), entityType)); }
public static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType) { return (containsComputedAttribute(query.getSort(), entityType) || containsComputedAttribute(query.getRules(), entityType)); }
QueryUtils { public static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType) { return (containsComputedAttribute(query.getSort(), entityType) || containsComputedAttribute(query.getRules(), entityType)); } }
QueryUtils { public static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType) { return (containsComputedAttribute(query.getSort(), entityType) || containsComputedAttribute(query.getRules(), entityType)); } private  QueryUtils(); }
QueryUtils { public static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType) { return (containsComputedAttribute(query.getSort(), entityType) || containsComputedAttribute(query.getRules(), entityType)); } 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 containsComputedAttribute(Query<Entity> query, EntityType entityType) { return (containsComputedAttribute(query.getSort(), entityType) || containsComputedAttribute(query.getRules(), entityType)); } 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);  }