@Override public Set<Entry<K, K>> entrySet() { return new LinkedHashSet<Entry<K, K>>(Transformed.collection(collection, new Function<K, Entry<K, K>>() { public Map.Entry<K, K> get(final K input) { return new SimpleEntry<K>(input); }; })); }
@Override public EnclosedIterable<SearchRequest> getAll() { return enclosedIterable(searchRequestStore.getAll(), this::setSharePermissions); }
public Entry<K, V> get(final Entry<K, I> entry) { return entry(entry, transformer); } });
@Override public Iterator<E> iterator() { return Transformed.iterator(new UnmodifiableIterator<I>(list.iterator()), transformer); }
public List<QueryLiteral> getValues(final QueryCreationContext queryCreationContext, final FunctionOperand operand, final TerminalClause terminalClause) { notNull("queryCreationContext", queryCreationContext); if (queryCreationContext.getQueryUser() == null) { return Collections.emptyList(); } return ImmutableList.copyOf(Transformed.iterable(getWatchedIssues(queryCreationContext.getQueryUser(), queryCreationContext.isSecurityOverriden()), new Function<Long, QueryLiteral>() { public QueryLiteral get(final Long votedIssue) { return new QueryLiteral(operand, votedIssue); } })); }
/** Each ChangeItem consists of a field and a value; here, return the longest human-readable field name. */ private int getMaxFieldLength(final List<GenericValue> changeItems, final I18nHelper i18n) { return getMaxFieldLength(Transformed.list(changeItems, new Function<GenericValue, String>() { public String get(final GenericValue changeItem) { return getFieldName(changeItem, i18n); } })); }
@Override public Iterator<E> iterator() { return Transformed.iterator(new UnmodifiableIterator<I>(set.iterator()), transformer); }
public List<QueryLiteral> getValues(final QueryCreationContext queryCreationContext, final FunctionOperand operand, final TerminalClause terminalClause) { notNull("queryCreationContext", queryCreationContext); if (queryCreationContext.getQueryUser() == null) { return Collections.emptyList(); } return ImmutableList.copyOf(Transformed.iterable(getVotedIssues(queryCreationContext.getQueryUser(), queryCreationContext.isSecurityOverriden()), new Function<Long, QueryLiteral>() { public QueryLiteral get(final Long votedIssue) { return new QueryLiteral(operand, votedIssue); } })); }
@Override public EnclosedIterable<SharedEntity> getAllIndexableSharedEntities() { return enclosedIterable(searchRequestStore.getAllIndexableSharedEntities(), sharedEntityPermissionsResolver); }
public Collection<IssueType> getIssueTypeObjects() { return Transformed.collection(getIssueTypes(), new Function<String, IssueType>() { public IssueType get(final String input) { return ComponentAccessor.getConstantsManager().getIssueTypeObject(input); } }); }
@Override public Iterator<E> iterator() { return Transformed.iterator(new UnmodifiableIterator<E>(set.iterator()), transformer); }
@Override public EnclosedIterable<PortalPage> get(final RetrievalDescriptor descriptor) { return Transformed.enclosedIterable(portalPageStore.get(descriptor), permissionResolver); }
public static ProjectRoleActorsBean from(final Set<RoleActor> roleActors) { Collection<RoleActorBean> beans = Transformed.collection(roleActors, new Function<RoleActor, RoleActorBean>() { public RoleActorBean get(RoleActor actor) { return RoleActorBean.convert(actor); } }); return new ProjectRoleActorsBean(beans); }
@Override public Iterator<E> iterator() { return Transformed.iterator(new UnmodifiableIterator<I>(collection.iterator()), transformer); }
@Override public EnclosedIterable<SearchRequest> get(final RetrievalDescriptor descriptor) { return enclosedIterable(searchRequestStore.get(descriptor), this::setSharePermissions); }
public List<String> getIdsFromName(final String name) { final Collection<IssueSecurityLevel> levels = resolver.getIssueSecurityLevelsByName(authenticationContext.getUser(), false, name); return new ArrayList<String>(Transformed.collection(levels, new Function<IssueSecurityLevel, String>() { public String get(final IssueSecurityLevel issueSecurityLevel) { return issueSecurityLevel.getId().toString(); } })); }
@Override public EnclosedIterable<PortalPage> getAll() { return Transformed.enclosedIterable(portalPageStore.getAll(), permissionResolver); }
@Override public ProjectRoleBean projectRole(@Nonnull final Project project, @Nonnull final ProjectRole projectRole, @Nonnull final ProjectRoleActors projectRoleActors, @Nullable final ApplicationUser loggedInUser) { // Sort the actors by name, as opposed to parameter final SortedSet<RoleActor> sortedActors = new TreeSet<RoleActor>(RoleActorComparator.COMPARATOR); sortedActors.addAll(projectRoleActors.getRoleActors()); final Collection<RoleActorBean> actors = Transformed.collection(sortedActors, new Function<RoleActor, RoleActorBean>() { public RoleActorBean get(RoleActor actor) { final RoleActorBean bean = RoleActorBean.convert(actor); bean.setAvatarUrl(avatarService.getAvatarURL(loggedInUser, bean.getName(), Avatar.Size.SMALL)); return bean; } }); final ProjectRoleBean projectRoleBean = projectRole(project, projectRole); projectRoleBean.actors = actors; return projectRoleBean; }
@Override public EnclosedIterable<SearchRequest> get(final ApplicationUser user, final RetrievalDescriptor descriptor) { final Function<SearchRequest, SearchRequest> transformer = createPermissionSanitisingResolver(user); return Transformed.enclosedIterable(searchRequestStore.get(descriptor), new com.atlassian.jira.util.Function<SearchRequest, SearchRequest>() { @Override public SearchRequest get(SearchRequest input) { return transformer.apply(input); } }); }
public Collection<TaskDescriptor<?>> getAllTasks() { return sortIntoIdOrder(Transformed.collection(getTasks(taskMap), COPY)); }