Check if this resources matches the supplied product definition

@param def The product definition to check against
@return A {@link MatchResult} that says whether the resource matches the product definition, and if
not the reason why the match failed.
498869
public MatchResult matches(ProductDefinition def) {
        Collection<AppliesToFilterInfo> atfiList = _asset.getWlpInformation().getAppliesToFilterInfo();
        if (atfiList == null || atfiList.isEmpty()) {
            return MatchResult.NOT_APPLICABLE;
        }
        MatchResult matchResult = MatchResult.MATCHED;
        for (AppliesToFilterInfo atfi : atfiList) {
            if (!!!atfi.getProductId().equals(def.getId())) {
                // This one isn't applicable, maybe the next one is
                matchResult = MatchResult.NOT_APPLICABLE;
                continue;
            } else {
                if (def.getVersion() != null && !def.getVersion().isEmpty()) {

                    Version checkVersion = new Version(def.getVersion());
                    VersionRange vr = FilterVersion.getFilterRange(atfi.getMinVersion(), atfi.getMaxVersion());

                    if (!vr.includes(checkVersion)) {
                        return MatchResult.INVALID_VERSION;
                    }
                }

                if (atfi.getRawEditions() != null && !!!atfi.getRawEditions().isEmpty() && !!!atfi.getRawEditions().contains(def.getEdition())) {
                    return MatchResult.INVALID_EDITION;
                }

                if (atfi.getInstallType() != null && !!!atfi.getInstallType().equals(def.getInstallType())) {
                    return MatchResult.INVALID_INSTALL_TYPE;
                }

                // Got here so this must have been a match, only need one of the array to match, not all
                return MatchResult.MATCHED;
            }
        }
        return matchResult;
    }
1359550
public boolean find(int start, MatchResults result) {
        if (!matcher.find(start)) return false;
        applyMatch(result);
        return true;
    }
1322754
public boolean matchesFilter(String filter) {

        filter = filter.toLowerCase();
        return m_title.toLowerCase().contains(filter) || m_path.toLowerCase().contains(filter);
    }
1226430
@Override
    public final MatchResult matches(final List<String> lines) {
        for (int i = 0; i < lines.size(); i++) {
            if (matches(i + 1, lines.get(i))) return new MatchResult(true, this, i);
        }
        return NO_MATCH;
    }
612492
boolean matches(String value) {
    if (pattern == null) {
      return true;
    }
    return pattern.matcher(value).matches();
  }
316744
public boolean matches(String target, Match match) {
		return this.matches(target, 0, target.length(), match);
	}
111317
public ResultMatcher isPresent() {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                isPresent(actual);
            }
        };
    }
104957
public static boolean matches(Pattern patternMatcher, Object... elements)
    {
        if (patternMatcher == null) {
            return true;
        }

        for (Object element : elements) {
            if (matches(patternMatcher, element)) {
                return true;
            }
        }

        return false;
    }
1349225
public boolean isMatched(String value, Boolean defaultValue)
    {
        if (value == null)
            return false;

        if (_match != null) {
            for (int i = 0; i < _match.length; i++) {
                if (value.equals(_match[i]))
                    return true;
            }
        }
        else {
            // a provided default value will override the group
            if (defaultValue != null)
                return defaultValue.booleanValue();

            // if we have a singleton definition then use that
            if (_defaultSingleton)
                return _defaultSingleValue;

            // check to see if we have a default arraylist with the value in it
            if (_defaultSelections != null)
                return _defaultSelections.contains(value);
        }

        return false;
    }
364231
protected boolean isResidualMatch(InternalQName itemName, T[] recipientDefinition)
   {
      boolean containsResidual = false;
      for (int i = 0; i < recipientDefinition.length; i++)
      {
         if (itemName.equals(recipientDefinition[i].getName()))
            return false;
         else if (Constants.JCR_ANY_NAME.equals(recipientDefinition[i].getName()))
            containsResidual = true;
      }
      return containsResidual;
   }
519919
public final boolean matches(@NotNull final String targetPath) {
        Contract.requireArgNotNull("targetPath", targetPath);
        if (regExpr == null) {
            return true;
        }
        return regExpr.matcher(targetPath).find();
    }
975640
public static boolean getBooleanStyleable(Context ctx, @StyleableRes int styleable, boolean def) {
        TypedArray ta = ctx.getTheme().obtainStyledAttributes(R.styleable.MaterialDrawer);
        return ta.getBoolean(styleable, def);
    }
133915
public boolean getBool(String name, boolean def) {
        final String s = getProperty(name);
        if (s == null) {
            return def;
        }
        try {
            return s != null && s.equalsIgnoreCase("true");
        } catch (Exception e) {
            return def;
        }
    }
1085759
public ResultMatcher isAbsent() {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                if (!nodeAbsent(actual, path, configuration)) {
                    failWithMessage("Node \"" + path + "\" is present.");
                }
            }
        };
    }
913520
public <V> boolean contains(IndexDefinition<T, V> indexDefinition, V value) {
    FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition);
    if (index == null) {
      throw new IllegalStateException("the given index isn't defined for this IndexedSet");
    }
    return index.containsField(value);
  }
627685
public boolean match(String vfsName) {

        for (int j = 0; j < m_relatedSystemResources.size(); j++) {
            Pattern pattern = m_relatedSystemResources.get(j);
            if (pattern.matcher(vfsName).matches()) {
                return true;
            }
        }
        return false;
    }
1245712
public static boolean matches(Collection<Filter> filters, Extension extension)
    {
        if (filters != null) {
            for (Filter filter : filters) {
                if (!matches(filter, extension)) {
                    return false;
                }
            }
        }

        return true;
    }