public static List<ProjectOption> transform(final Iterable<? extends Project> projects) { return CollectionUtil.transform(projects, new Function<Project, ProjectOption>() { @Override public ProjectOption get(final Project input) { return new ProjectOption(input); } }); }
SelectedValues(Collection<String> selectedValues) { this.selectedValuesInLowerCase = CollectionUtil.transform(selectedValues, new Function<String, String>() { @Override public String get(String value) { return value.toLowerCase(); } }); }
@Nonnull public List<Project> getProjects(@Nonnull Collection<GenericValue> projectGVs) { notNull("projectGVs", projectGVs); return CollectionUtil.transform(projectGVs, gvToProjectTransformer); } }
private Set<Label> getSortedLabelSet(final List<GenericValue> labelGvs) { final Set<Label> labels = new TreeSet<Label>(LabelComparator.INSTANCE); labels.addAll(CollectionUtil.transform(labelGvs, new GenericValueToLabel())); return Collections.unmodifiableSet(labels); }
private List<Long> getTemporaryFileIdsToConvert() { final String[] strings = getFiletoconvert(); if (strings == null) { return Collections.emptyList(); } final List<String> fileIdStrings = Arrays.asList(strings); return CollectionUtil.transform(fileIdStrings, input -> Long.parseLong(input)); }
/** * @param user the user * @param projects the projects to check; if empty the result will be false. * @return if there are any issues in the scheme's associated projects */ private boolean doProjectsHaveIssues(final ApplicationUser user, final Collection<Project> projects) { final List<Long> projectIds = CollectionUtil.transform(projects, PROJECT_TO_ID_FUNCTION); return doProjectIdsHaveIssues(user, projectIds); }
@Override protected List<String> getAllConstantNames() { // if any existing resolutions were called Unresolved, we need to quote and escape them final List<String> constantNames = new ArrayList<String>(CollectionUtil.transform(getAllConstants().iterator(), resolutionToNameFunction)); // add the Unresolved value as an option constantNames.add(ResolutionSystemField.UNRESOLVED_OPERAND); return constantNames; }
public static <T, R> Iterable<R> transformAndFilter(final Iterable<T> iterable, final Function<T, R> transformer, final Predicate<R> predicate) { return filter(transform(iterable, transformer), predicate); }
@Override public String toString() { final Collection<String> issueKeys = CollectionUtil.transform(issueObjects, new Function<Issue, String>() { public String get(final Issue object) { return object.getKey(); } }); return getClass().getName() + " (" + size() + " items): " + issueKeys; } }
@Override public Collection<C> values() { return CollectionUtil.transform(delegate.values(), unmodifiableTransformer); }
@Override public Collection<SearchRequest> getAllOwnedSearchRequests(final String userKey) { return CollectionUtil.transform(getSearchRequestGVsOwnedBy(userKey).iterator(), searchRequestResolver); }
@Override @Nonnull public Collection<String> getFieldIds(final String jqlClauseName) { return transform(filter(getHelper().getSearchHandler(jqlClauseName), hasFieldId), getFieldId); }
void setProjectsWithBrowsePermission(final ApplicationUser user, final Collection<GenericValue> projectsWithBrowsePermission) { //JRA-16757: Make an immutable copy of the returned list and return it. This will give a runtime exception anyone that is trying //to modify the list inline. final CacheKey cacheKey = new CacheKey(user); projectsWithBrowsePermissionForUser.put(cacheKey, CollectionUtil.copyAsImmutableList(projectsWithBrowsePermission)); projectObjectsWithBrowsePermissionForUser.put(cacheKey, CollectionUtil.transform(projectsWithBrowsePermission, gvToProjectTransformer)); }
List<Option> convertGVsToOptions(final List<GenericValue> optionGvs) { return new ArrayList<Option>(CollectionUtil.transform(optionGvs, new GenericValueToOption())); }
public List<String> getIdsFromName(final String name) { notNull("name", name); Collection<Version> versions = versionManager.getVersionsByName(name); Function<Version, String> function = new Function<Version, String>() { public String get(final Version input) { return input.getId().toString(); } }; return CollectionUtil.transform(versions, function); }
public List<String> getIdsFromName(final String name) { notNull("name", name); Collection<ProjectComponent> components = componentManager.findByComponentNameCaseInSensitive(name); Function<ProjectComponent, String> function = new Function<ProjectComponent, String>() { public String get(final ProjectComponent input) { return input.getId().toString(); } }; return CollectionUtil.transform(components, function); }
public Clause visit(final OrClause orClause) { return new OrClause(transform(orClause.getClauses(), optimizer)); }
/** * Add edit template paramters to the given velocity parameters map. */ void addEditParameters(ApplicationUser searcher, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map<String, Object> velocityParameters) { @SuppressWarnings("unchecked") Collection<I> selectedValues = (Collection<I>) fieldValuesHolder.get(searchConstants.getUrlParameter()); velocityParameters.put("optionGroups", getOptions(searcher, selectedValues, searchContext)); Collection<String> selectedOptionKeys = CollectionUtil.transform(selectedValues, inputValueToOptionIdFunction()); velocityParameters.put("selectedValues", new SelectedValues(selectedOptionKeys)); }
public List<Long> getConfigSchemeIdsForCustomFieldId(final String customFieldId) { Assertions.notNull("customFieldId", customFieldId); final List<GenericValue> configs = ofBizDelegator.findByAnd(ENTITY_TABLE_NAME, MapBuilder.build(ENTITY_FIELD, customFieldId)); return CollectionUtil.transform(configs, GenericValueFunctions.getLong(ENTITY_ID)); }
private Collection<TaskDescriptor<?>> findTasksInternal(final TaskMatcher matcher) { notNull("matcher", matcher); return toList(transform(filter(getTasks(taskMap), new TaskMatcherPredicate(matcher)), Functions.<TaskDescriptor<?>, TaskDescriptor<?>>coerceToSuper())); }