Get Build Projects filtered by the criteria specified in the passed in
filter.

@param filter Limit the items returned. If null, then all items returned.
@return Collection of items as specified in the filter.
488696
public Collection<BuildProject> buildProjects(BuildProjectFilter filter) {
        return get(BuildProject.class, (filter != null) ? filter : new BuildProjectFilter());
    }
1069091
public Collection<BuildRun> buildRuns(BuildRunFilter filter) {
        return get(BuildRun.class, (filter != null) ? filter : new BuildRunFilter());
    }
360522
public static HashMap<String, String> getUrlVariables(final Filter filter) {
        final HashMap<String, String> vars = new HashMap<String, String>();

        for (final FilterTag filterTag : filter.getFilterTags()) {
            final Tag tag = filterTag.getTag();
            final Integer tagState = filterTag.getTagState();

            if (tagState == CommonFilterConstants.MATCH_TAG_STATE) {
                vars.put(CommonFilterConstants.MATCH_TAG + tag.getTagId(), CommonFilterConstants.MATCH_TAG_STATE + "");
            } else if (tagState == CommonFilterConstants.NOT_MATCH_TAG_STATE) {
                vars.put(CommonFilterConstants.MATCH_TAG + tag.getTagId(), CommonFilterConstants.NOT_MATCH_TAG_STATE + "");
            } else if (tagState == CommonFilterConstants.GROUP_TAG_STATE) {
                vars.put(CommonFilterConstants.GROUP_TAG + tag.getTagId(), CommonFilterConstants.GROUP_TAG_STATE + "");
            }
        }

        for (final FilterCategory filterCategory : filter.getFilterCategories()) {
            final Category category = filterCategory.getCategory();
            final Project project = filterCategory.getProject();

            if (filterCategory.getCategoryState() == CommonFilterConstants.CATEGORY_INTERNAL_AND_STATE) {
                vars.put(
                        CommonFilterConstants.CATEORY_INTERNAL_LOGIC + category.getCategoryId() + (project == null ? "" : "-" + project
                                .getProjectId()),
                        CommonFilterConstants.AND_LOGIC);
            }

            // don't add a url var for the "or" internal logic, as this is the
            // default

            else if (filterCategory.getCategoryState() == CommonFilterConstants.CATEGORY_EXTERNAL_OR_STATE) {
                vars.put(
                        CommonFilterConstants.CATEORY_EXTERNAL_LOGIC + category.getCategoryId() + (project == null ? "" : "-" + project
                                .getProjectId()),
                        CommonFilterConstants.OR_LOGIC);
            }

            // don't add a url var for the "and" external logic, as this is the
            // default
        }

        int count = 1;
        for (final FilterLocale filterLocale : filter.getFilterLocales()) {
            final Integer localeState = filterLocale.getLocaleState();

            if (localeState == CommonFilterConstants.MATCH_TAG_STATE) {
                vars.put(CommonFilterConstants.MATCH_LOCALE + count, filterLocale.getLocaleName() + CommonFilterConstants.MATCH_TAG_STATE);
            } else if (localeState == CommonFilterConstants.NOT_MATCH_TAG_STATE) {
                vars.put(CommonFilterConstants.MATCH_LOCALE + count,
                        filterLocale.getLocaleName() + CommonFilterConstants.NOT_MATCH_TAG_STATE);
            }
            count++;
        }

        boolean foundFilterField = false;
        boolean foundFilterFieldLogic = false;
        for (final FilterField filterField : filter.getFilterFields()) {
            try {
                vars.put(filterField.getField(), URLEncoder.encode(filterField.getValue(), "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }
            if (!filterField.getField().equals(CommonFilterConstants.LOGIC_FILTER_VAR)) foundFilterField = true;
            else foundFilterFieldLogic = true;
        }

        /*
         * if we have found some filter fields, but did not find the filter
         * logic, use the default value
         */
        if (foundFilterField && !foundFilterFieldLogic)
            vars.put(CommonFilterConstants.LOGIC_FILTER_VAR, FilterConstants.LOGIC_FILTER_VAR_DEFAULT_VALUE);

        return vars;
    }
514779
private Project findProjectInDirectory(Resource<?> target, ProjectProvider projectProvider,
            Predicate<Project> filter)
   {
      Project result = null;
      Imported<ProjectCache> caches = getCaches();
      if (projectProvider.containsProject(target))
      {
         boolean cached = false;
         for (ProjectCache cache : caches)
         {
            result = cache.get(target);
            if (result != null && !filter.accept(result))
            {
               result = null;
            }
            if (result != null)
            {
               cached = true;
               break;
            }
         }
         if (result == null)
         {
            result = projectProvider.createProject(target);
         }
         if (result != null && !filter.accept(result))
         {
            result = null;
         }
         if (result != null && !cached)
         {
            registerAvailableFacets(result);
            cacheProject(result);
         }
      }

      return result;
   }
470869
public List<?> getList(PMContext ctx, EntityFilter filter) throws PMException {
        return getList(ctx, filter, null, null, null);
    }
754976
public static filterpolicy[] get_filtered(nitro_service service, String filter) throws Exception{
		filterpolicy obj = new filterpolicy();
		options option = new options();
		option.set_filter(filter);
		filterpolicy[] response = (filterpolicy[]) obj.getfiltered(service, option);
		return response;
	}
855977
def get_build(self, project, build_id, property_filters=None):
        
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url('project', project, 'str')
        if build_id is not None:
            route_values['buildId'] = self._serialize.url('build_id', build_id, 'int')
        query_parameters = {}
        if property_filters is not None:
            query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str')
        response = self._send(http_method='GET',
                              location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf',
                              version='5.0',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('Build', response)
1217702
public R filterMany(ExpressionList<T> filter) {

    @SuppressWarnings("unchecked")
    ExpressionList<T> expressionList = (ExpressionList<T>) expr().filterMany(_name);
    expressionList.addAll(filter);
    return _root;
  }
1124460
public Collection<Link> links(LinkFilter filter) {
        return get(Link.class, (filter != null) ? filter : new LinkFilter());
    }
1058709
public Collection<Workitem> workitems(WorkitemFilter filter) {
        return get(Workitem.class, (filter != null) ? filter : new WorkitemFilter());
    }
166752
public Map<Addon, List<URL>> scanForAddonMap(Predicate<String> filter)
    {
        Map<Addon, List<URL>> result = new IdentityHashMap<>();

        // For each Forge addon...
        for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted()))
        {
            List<String> filteredResourcePaths = filterAddonResources(addon, filter);

            List<URL> discoveredURLs = new ArrayList<>();
            for (String filePath : filteredResourcePaths)
            {
                URL ruleFile = addon.getClassLoader().getResource(filePath);
                if (ruleFile != null)
                    discoveredURLs.add(ruleFile);
            }
            if (!discoveredURLs.isEmpty())
                result.put(addon, discoveredURLs);
        }
        return result;
    }
551405
public Collection<Goal> goals(GoalFilter filter) {
        return get(Goal.class, (filter != null) ? filter : new GoalFilter());
    }
687385
private static void processResourceFilter(ProjectFile project, Filter filter)
   {
      for (Resource resource : project.getResources())
      {
         if (filter.evaluate(resource, null))
         {
            System.out.println(resource.getID() + "," + resource.getUniqueID() + "," + resource.getName());
         }
      }
   }
657576
public Collection<Attachment> attachments(AttachmentFilter filter) {
        return get(Attachment.class, (filter != null) ? filter : new AttachmentFilter());
    }
732032
public Document buildFilter(List<PackageFilter> filters) {
    Document doc = documentBuilder.newDocument();

    Element workspaceFilterElement = doc.createElement("workspaceFilter");
    workspaceFilterElement.setAttribute("version", "1.0");
    doc.appendChild(workspaceFilterElement);

    for (PackageFilter filter : filters) {
      Element filterElement = doc.createElement("filter");
      filterElement.setAttribute("root", filter.getRootPath());
      workspaceFilterElement.appendChild(filterElement);

      for (PackageFilterRule rule : filter.getRules()) {
        Element ruleElement = doc.createElement(rule.isInclude() ? "include" : "exclude");
        ruleElement.setAttribute("pattern", rule.getPattern());
        filterElement.appendChild(ruleElement);
      }
    }

    return doc;
  }
1176552
public List<CmsProject> filterProjectsForSelector(List<CmsProject> projects) {

        List<CmsProject> result = new ArrayList<CmsProject>();
        for (CmsProject project : projects) {
            if (!project.isHiddenFromSelector()) {
                result.add(project);
            }
        }
        return result;
    }
863722
public Collection<Task> tasks(TaskFilter filter) {
        return get(Task.class, (filter != null) ? filter : new TaskFilter());
    }