public boolean test()

in scim-spec/scim-spec-schema/src/main/java/org/apache/directory/scim/spec/filter/InMemoryScimFilterMatcher.java [111:139]


    public boolean test(R actual) {

      try {
        // get and validate attribute
        Schema.Attribute resolvedAttribute = attribute(attributeContainer, attributeReference);
        if (resolvedAttribute != null) {

          // now walk the attribute path again to get the accessor and value
          Schema.Attribute schemaAttribute = attributeContainer.getAttribute(attributeReference.getAttributeName());

          // check if the filter is nested such as: `emails[type eq "work"].value`
          if (!(attributeReference.hasSubAttribute() && schemaAttribute.isMultiValued())) {
            actual = get(schemaAttribute, actual);
          }
          // if the attribute has a sub-level, continue on
          String subAttribute = attributeReference.getSubAttributeName();
          if (subAttribute != null) {
            schemaAttribute = schemaAttribute.getAttribute(subAttribute);
            actual = get(schemaAttribute, actual);
          }
          return test(schemaAttribute, actual);
        }
      } catch (Exception e) {
        // The SCIM spec states to ignore the query instead of rejecting it - rfc7644 - 3.4.2
        log.debug("Invalid SCIM filter received", e);
      }

      return false;
    }