Tabnine Logo
CollectionUtil.transform
Code IndexAdd Tabnine to your IDE (free)

How to use
transform
method
in
com.atlassian.jira.util.collect.CollectionUtil

Best Java code snippets using com.atlassian.jira.util.collect.CollectionUtil.transform (Showing top 20 results out of 315)

origin: com.atlassian.jira/jira-core

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);
    }
  });
}
origin: com.atlassian.jira/jira-core

SelectedValues(Collection<String> selectedValues)
{
  this.selectedValuesInLowerCase = CollectionUtil.transform(selectedValues, new Function<String, String>()
  {
    @Override
    public String get(String value)
    {
      return value.toLowerCase();
    }
  });
}
origin: com.atlassian.jira/jira-core

  @Nonnull
  public List<Project> getProjects(@Nonnull Collection<GenericValue> projectGVs)
  {
    notNull("projectGVs", projectGVs);
    return CollectionUtil.transform(projectGVs, gvToProjectTransformer);
  }
}
origin: com.atlassian.jira/jira-core

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);
}
origin: com.atlassian.jira.plugins/jira-dnd-attachment-plugin

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));
}
origin: com.atlassian.jira/jira-core

/**
 * @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);
}
origin: com.atlassian.jira/jira-core

@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;
}
origin: com.atlassian.jira/jira-api

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);
}
origin: com.atlassian.jira/jira-core

  @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;
  }
}
origin: com.atlassian.jira/jira-api

@Override
public Collection<C> values()
{
  return CollectionUtil.transform(delegate.values(), unmodifiableTransformer);
}
origin: com.atlassian.jira/jira-core

@Override
public Collection<SearchRequest> getAllOwnedSearchRequests(final String userKey)
{
  return CollectionUtil.transform(getSearchRequestGVsOwnedBy(userKey).iterator(), searchRequestResolver);
}
origin: com.atlassian.jira/jira-core

@Override
@Nonnull
public Collection<String> getFieldIds(final String jqlClauseName)
{
  return transform(filter(getHelper().getSearchHandler(jqlClauseName), hasFieldId), getFieldId);
}
origin: com.atlassian.jira/jira-core

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));
}
origin: com.atlassian.jira/jira-core

List<Option> convertGVsToOptions(final List<GenericValue> optionGvs)
{
  return new ArrayList<Option>(CollectionUtil.transform(optionGvs, new GenericValueToOption()));
}
origin: com.atlassian.jira/jira-api

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);
}
origin: com.atlassian.jira/jira-core

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);
}
origin: com.atlassian.jira/jira-core

public Clause visit(final OrClause orClause)
{
  return new OrClause(transform(orClause.getClauses(), optimizer));
}
origin: com.atlassian.jira/jira-core

/**
 * 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));
}
origin: com.atlassian.jira/jira-core

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));
}
origin: com.atlassian.jira/jira-core

private Collection<TaskDescriptor<?>> findTasksInternal(final TaskMatcher matcher)
{
  notNull("matcher", matcher);
  return toList(transform(filter(getTasks(taskMap), new TaskMatcherPredicate(matcher)),
      Functions.<TaskDescriptor<?>, TaskDescriptor<?>>coerceToSuper()));
}
com.atlassian.jira.util.collectCollectionUtiltransform

Javadoc

Return a List that is transformed from elements of the input type to elements of the output type by a transformer function.

Note, this performs a copy and applies the transform to all elements. If you want a lazily applied function, see Transform

Popular methods of CollectionUtil

  • copyAsImmutableList
    Return an immutable list copy of the passed collection.
  • filter
    Create a filtered Iterator.
  • contains
    Does the supplied Iterator contain anything that matches the predicate?
  • foreach
    For each element in the iterator, consume the contents.
  • toList
    Turn the iterator into a list.
  • copyAsImmutableMap
    Return an immutable copy of the passed map. The type of the reurned map is not gaurenteed to match t
  • findFirstMatch
    Return the first found element that the predicate matches.
  • indexOf
    Returns the index of the first element that matches the predicate.
  • predicateAdapter
  • sort
    Copy and sort the passed collection and return an unmodifiable List of the elements.
  • toSet
    Turn the iterable into a Set.
  • transformIterator
    Return an Iterator that is transformed from elements of the input type to elements of the output typ
  • toSet,
  • transformIterator,
  • transformSet

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Collectors (java.util.stream)
  • JTextField (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now