class FilterUtility {

  public static boolean matchesSchemaKey(SchemaKey key, SchemaKeyQuery schemaKeyQuery) {
    if (schemaKeyQuery == null) {
      return true;
    }
    if (!matches(key.getDomain(), schemaKeyQuery.getDomainRegex())) {
      return false;
    }
    return matches(key.getName(), schemaKeyQuery.getNameRegex());
  }

}