public InActivities(Collection<Pair<Operator, Iterable<String>>> activities) { this.inActivities = isAndNot(activities); }
public InOptionActivities(Collection<Pair<Operator, Iterable<String>>> activities) { this.inActivities = isAndNot(activities); }
/** * Creates a {@code Predicate} to determine if a project key matches the filters from the request. If the request * does not contain any project key filters, the returned {@code Predicate} will return {@code true} for every * project key. * * @param request request to generate the project key predicate from * @return {@code Predicate} to determine if a project key matches the filters from the request */ public static Predicate<String> inProjectKeys(ActivityRequest request) { return isAndNot(request.getStandardFilters().get(PROJECT_KEY)); }
/** * Creates a {@code Predicate} to determine if a user name matches the filters from the request. If the request * does not contain any user filters, the returned {@code Predicate} will return {@code true} for every user name. * * @param request request to generate the user name predicate from * @return {@code Predicate} to determine if a user name matches the filters from the request */ public static Predicate<String> inUsers(final ActivityRequest request) { return isAndNot(request.getStandardFilters().get(USER.getKey())); }
/** * Creates a {@code Predicate} to determine if an issue key matches the filters from the request. If the request * does not contain any issue key filters, the returned {@code Predicate} will return {@code true} for every issue * key. * * @param request request to generate the issue key predicate from * @return {@code Predicate} to determine if an issue key matches the filters from the request */ public static Predicate<String> inIssueKeys(ActivityRequest request) { return isAndNot(request.getStandardFilters().get(ISSUE_KEY.getKey())); }
/** * Creates a {@code Predicate} to determine if an issue key matches the filters from the request. If the request * does not contain any issue key filters, the returned {@code Predicate} will return {@code true} for every issue * key. * * @param request request to generate the issue key predicate from * @param is {@code Function} which is used to construct the {@code Predicate} for checking if an issue key is in * the list of issue keys from the filter * @param not {@code Function}s which is used to construct the {@code Predicate} for checking if an issue key is not * in the list of issue keys from the filter * @return {@code Predicate} to determine if an issue key matches the filters from the request */ public static Predicate<String> inIssueKeys(ActivityRequest request, Function<Iterable<String>, Predicate<String>> is, Function<Iterable<String>, Predicate<String>> not) { return isAndNot(request.getStandardFilters().get(ISSUE_KEY.getKey()), is, not); }
public boolean apply(Issue issue) { return issue != null && isAndNot(request.getStandardFilters().get(PROJECT_KEY)).apply(issue.getProjectObject().getKey()); } };
/** * Creates a {@code Predicate} from the {@link IS} and {@link NOT} operators in the list of filters. The returned * {@code Predicate} uses the {@link Function}s returned by {@link isIn} and {@link notIn} to construct the sub * {@code Predicate}s for each {@code Operator}, and then {@link and}s them all together. * * @param filters filters to create a predicate for * @return {@code Predicate} from the {@code IS} and {@code NOT} filters */ public static Predicate<String> isAndNot(Iterable<Pair<Operator, Iterable<String>>> filters) { return isAndNot(filters, isIn(), notIn()); }
public boolean apply(Issue issue) { return issue != null && isAndNot(request.getProviderFilters().get(ISSUE_TYPE)).apply(issue.getIssueTypeObject().getId()); } };
@Override public boolean apply(final Issue issue) { if (issue == null) { return false; } ProjectCategory projectCategoryObject = issue.getProjectObject().getProjectCategoryObject(); // A non-categorized projects should be checked with this filter. That why null should be passed to be handled by the filter. final String categoryId = projectCategoryObject != null ? String.valueOf(projectCategoryObject.getId()) : null; return isAndNot(request.getProviderFilters().get(PROJECT_CATEGORY)).apply(categoryId); } }