@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); }; })); }
public Collection<IssueType> getIssueTypeObjects() { return Transformed.collection(getIssueTypes(), new Function<String, IssueType>() { public IssueType get(final String input) { return ComponentAccessor.getConstantsManager().getIssueTypeObject(input); } }); }
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 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; }
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(); } })); }
public Collection<TaskDescriptor<?>> getAllTasks() { return sortIntoIdOrder(Transformed.collection(getTasks(taskMap), COPY)); }
@Override public ProjectRoleBean projectRole(@Nonnull final ProjectRole projectRole, final DefaultRoleActors actors) { final ProjectRoleBean projectRoleBean = new ProjectRoleBean(); projectRoleBean.name = projectRole.getName(); projectRoleBean.id = projectRole.getId(); projectRoleBean.description = projectRole.getDescription(); projectRoleBean.self = uriInfo.getBaseUriBuilder().path(RoleResource.class).path(projectRoleBean.id.toString()).build(); if (actors != null && isNotEmpty(actors.getRoleActors())) { projectRoleBean.actors = Transformed.collection(actors.getRoleActors(), new Function<RoleActor, RoleActorBean>() { public RoleActorBean get(RoleActor actor) { return RoleActorBean.convert(actor); } }); } return projectRoleBean; }
if (outcome.isValid()) voters = new ArrayList<UserBean>(Transformed.collection(outcome.getReturnedValue(), new Function<ApplicationUser, UserBean>()