com.atlassian.jira.project.Project.getProjectCategoryObject()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中com.atlassian.jira.project.Project.getProjectCategoryObject()方法的一些代码示例,展示了Project.getProjectCategoryObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getProjectCategoryObject()方法的具体详情如下:
包路径:com.atlassian.jira.project.Project
类名称:Project
方法名:getProjectCategoryObject

Project.getProjectCategoryObject介绍

[英]Returns the Project Category for this Project.

This is a synonym for #getProjectCategory() that exists for legacy reasons.
[中]返回此项目的项目类别。
这是#getProjectCategory()的同义词,它是出于遗留原因而存在的。

代码示例

代码示例来源:origin: com.atlassian.streams/streams-jira-plugin

@Override
  public ProjectCategory apply(Project project)
  {
    return project.getProjectCategoryObject();
  }
};

代码示例来源:origin: com.atlassian.streams/streams-jira-plugin

@Override
  public boolean apply(final Project input)
  {
    return input.getProjectCategoryObject() != null;
  }
};

代码示例来源:origin: com.atlassian.jira/jira-core

public Map<ProjectCategory, List<Project>> getVisibleProjectsByCategory()
{
  if (visibleProjectsByCategory == null)
  {
    visibleProjectsByCategory = new TreeMap<ProjectCategory, List<Project>>(NameComparator.COMPARATOR);
    for (Project project : getCurrentVisibleProjects())
    {
      List<Project> projects = visibleProjectsByCategory.get(project.getProjectCategoryObject());
      if (projects == null)
      {
        projects = newArrayList();
        visibleProjectsByCategory.put(project.getProjectCategoryObject(), projects);
      }
      projects.add(project);
    }
    for (List<Project> projects : visibleProjectsByCategory.values())
    {
      Collections.sort(projects, ProjectNameComparator.COMPARATOR);
    }
  }
  return visibleProjectsByCategory;
}

代码示例来源:origin: com.atlassian.streams/streams-jira-plugin

@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);
  }
}

代码示例来源:origin: com.atlassian.jira/jira-gadgets-plugin

private List<Option> getCategoriesForProjects(Collection<Project> projects)
{
  final Set<Option> categoryOptionsSet = new HashSet<Option>();
  if ((projects != null) && !projects.isEmpty())
  {
    for (final Project project : projects)
    {
      final ProjectCategory category = project.getProjectCategoryObject();
      if (category != null)
      {
        categoryOptionsSet.add(new Option(category.getName(), "cat" + category.getId()));
      }
    }
  }
  final List<Option> categoryOptions = new ArrayList<Option>(categoryOptionsSet);
  Collections.sort(categoryOptions, new Comparator<Option>()
  {
    public int compare(Option option, Option option1)
    {
      return option.getLabel().compareTo(option1.getLabel());
    }
  });
  return categoryOptions;
}

代码示例来源:origin: com.atlassian.jira/jira-api

public static ProjectJsonBean shortBean(Project project, final JiraBaseUrls urls)
{
  if (project == null)
  {
    return null;
  }
  final ProjectJsonBean bean = new ProjectJsonBean();
  bean.self = urls.restApi2BaseUrl() + "project/" + project.getId().toString();
  bean.id = project.getId().toString();
  bean.key = project.getKey();
  bean.name = project.getName();
  bean.avatarUrls = getAvatarUrls(project);
  bean.projectCategory = ProjectCategoryJsonBean.bean(project.getProjectCategoryObject(), urls);
  return bean;
}

代码示例来源:origin: com.atlassian.jira/jira-core

public ProjectBean(final Project project, final boolean recent)
{
  this(
      project.getKey(),
      project.getName(),
      project.getId(),
      hasDefaultAvatar(project),
      project.getProjectLead(),
      project.getProjectCategoryObject(),
      recent,
      project.getUrl(),
      project.getProjectTypeKey()
  );
}

代码示例来源:origin: com.atlassian.jira/jira-webhooks-plugin

public ProjectBean createBean(final Project project) {
  return new ProjectBean(createSelfLink(project),
      project.getId(),
      project.getKey(),
      project.getName(),
      ProjectJsonBean.getAvatarUrls(project),
      createProjectCategoryBean(project.getProjectCategoryObject()),
      createLeadBean(project),
      ProjectAssigneeTypes.getPrettyAssigneeType(project.getAssigneeType())
  );
}

代码示例来源:origin: com.atlassian.jira/jira-rest-plugin

private ProjectBeanBuilder shortProjectBuilder(Project project)
{
  return new ProjectBeanBuilder()
      .self(createSelfLink(project))
      .key(project.getKey())
      .name(project.getName())
      .id(project.getId())
      .avatarUrls(ProjectJsonBean.getAvatarUrls(project))
      .projectCategory(project.getProjectCategoryObject())
      .projectTypeKey(project.getProjectTypeKey().getKey())
      .expandUrl();
}

相关文章