com.atlassian.jira.project.version.Version.isReleased()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(116)

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

Version.isReleased介绍

暂无

代码示例

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

@Override
  public boolean apply(@Nullable final Version version)
  {
    return version != null && version.isReleased();
  }
};

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

@Override
public boolean shouldDisplay(Map<String, Object> context)
{
  if (context.containsKey(VERSION_KEY))
  {
    Version version = getVersion(context);
    if (version != null)
    {
      return version.isReleased();
    }
  }
  return false;
}

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

@Override
public List<Version> getVersionsReleased(Long projectId, boolean includeArchived)
{
  List<Version> v = Lists.newArrayList();
  for (Version version : versions.values())
  {
    if (projectId.equals(version.getProjectId()) && version.isReleased())
    {
      if (!version.isArchived() || includeArchived)
      {
        v.add(version);
      }
    }
  }
  return v;
}

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

@Override
public Collection<Version> getVersionsUnreleased(Long projectId, boolean includeArchived)
{
  List<Version> v = Lists.newArrayList();
  for (Version version : versions.values())
  {
    if (projectId.equals(version.getProjectId()) && !version.isReleased())
    {
      if (!version.isArchived() || includeArchived)
      {
        v.add(version);
      }
    }
  }
  return v;
}

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

public boolean isVersionOverDue(final Version version)
{
  if (version.getReleaseDate() == null || version.isArchived() || version.isReleased())
  {
    return false;
  }
  final Calendar releaseDate = Calendar.getInstance();
  releaseDate.setTime(version.getReleaseDate());
  final Calendar lastMidnight = Calendar.getInstance();
  lastMidnight.set(Calendar.HOUR_OF_DAY, 0);
  lastMidnight.set(Calendar.MINUTE, 0);
  lastMidnight.set(Calendar.SECOND, 0);
  lastMidnight.set(Calendar.MILLISECOND, 0);
  return releaseDate.before(lastMidnight);
}

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

private List<String> getVersionClasses(final Version version)
{
  final List<String> classes = new ArrayList<String>();
  if (version.isArchived())
  {
    classes.add("archived_version");
  }
  classes.add("default_image");
  if (version.isReleased() && !version.isArchived())
  {
    classes.add("released_unarchived_version");
  }
  else if (version.isReleased() && version.isArchived())
  {
    classes.add("released_archived_version");
  }
  else if (!version.isReleased() && !version.isArchived())
  {
    classes.add("unreleased_unarchived_version");
  }
  else if (!version.isReleased() && version.isArchived())
  {
    classes.add("unreleased_archived_version");
  }
  return classes;
}

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

public static RemoteVersion[] convertVersionsToRemoteObject(Collection versions)
{
  RemoteVersion[] result = new RemoteVersion[versions.size()];
  int count = 0;
  for (Iterator iterator = versions.iterator(); iterator.hasNext();)
  {
    Version version = (Version) iterator.next();
    result[count++] = new RemoteVersion(version.getId().toString(), version.getName(), version.isReleased()
        , version.isArchived(), version.getSequence(), version.getReleaseDate());
  }
  return result;
}

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

@Override
@Nonnull
public ReleaseVersionValidationResult validateReleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nullable Date releaseDate)
{
  final ErrorCollection errors = new SimpleErrorCollection();
  final I18nHelper i18nBean = getI18nBean(user);
  checkVersionValid(errors, i18nBean, user, version);
  if (errors.hasAnyErrors())
  {
    return new ReleaseVersionValidationResult(errors);
  }
  if (version.isReleased())
  {
    errors.addErrorMessage(i18nBean.getText("admin.errors.release.already.released"));
  }
  if (errors.hasAnyErrors())
  {
    return new ReleaseVersionValidationResult(errors);
  }
  return new ReleaseVersionValidationResult(errors, version, releaseDate);
}

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

@Override
@Nonnull
public ReleaseVersionValidationResult validateUnreleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nullable Date releaseDate)
{
  final ErrorCollection errors = new SimpleErrorCollection();
  final I18nHelper i18nBean = getI18nBean(user);
  checkVersionValid(errors, i18nBean, user, version);
  if (errors.hasAnyErrors())
  {
    return new ReleaseVersionValidationResult(errors);
  }
  if (!version.isReleased())
  {
    errors.addErrorMessage(i18nBean.getText("admin.errors.release.not.released"));
  }
  if (errors.hasAnyErrors())
  {
    return new ReleaseVersionValidationResult(errors);
  }
  return new ReleaseVersionValidationResult(errors, version, releaseDate);
}

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

/**
   *
   * @return null if the input is null
   */
  public static VersionJsonBean shortBean(final Version version, final JiraBaseUrls urls)
  {
    if (version == null)
    {
      return null;
    }
    final VersionJsonBean bean = new VersionJsonBean();
    bean.self = urls.restApi2BaseUrl() + "version/" + JiraUrlCodec.encode(version.getId().toString());
    bean.id = version.getId().toString();
    bean.description = version.getDescription();
    bean.name = version.getName();
    bean.released = version.isReleased();
    bean.releaseDate = version.getReleaseDate();
    bean.archived = version.isArchived();

    return bean;
  }
}

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

public VersionBuilderImpl(Version version)
{
  this.version = version;
  this.projectId = version.getProjectId();
  this.sequence = version.getSequence();
  this.name = version.getName();
  this.description = version.getDescription();
  this.startDate = version.getStartDate();
  this.releaseDate = version.getReleaseDate();
  this.released = version.isReleased();
  this.archived = version.isArchived();
}

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

public Builder setVersion(Version version)
{
  this.id = version.getId();
  this.name = version.getName();
  this.description = StringUtils.stripToNull(version.getDescription());
  this.startDate = version.getStartDate();
  this.releaseDate = version.getReleaseDate();
  this.archived = version.isArchived();
  this.released = version.isReleased();
  return this;
}

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

public ProjectVersionBean(final Version version, final Project project, final String url)
{
  this.id = version.getId();
  this.description = version.getDescription();
  this.name = version.getName();
  this.url = url;
  this.archived = version.isArchived();
  this.released = version.isReleased();
  this.startDate = version.getStartDate();
  this.releaseDate = version.getReleaseDate();
  this.project = new SimpleProjectBean(project);
}

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

public Map<String, Object> fieldMapFrom(Version value)
{
  FieldMap map = new FieldMap();
  map.add("project", value.getProjectId());
  map.add("id", value.getId());
  map.add("name", value.getName());
  map.add("description", value.getDescription());
  map.add("sequence", value.getSequence());
  map.add("archived", value.isArchived() ? "true" : null);
  map.add("released", value.isReleased() ? "true" : null);
  map.add("releasedate", copyDate(value.getReleaseDate()));
  map.add("startdate", copyDate(value.getStartDate()));
  return map;
}

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

if (bean.isReleased() && !currentVersion.isReleased())
else if (!bean.isReleased() && currentVersion.isReleased())

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

if (bean.isReleased() && !currentVersion.isReleased())
else if (!bean.isReleased() && currentVersion.isReleased())

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

public VersionBean createBean(Version version) {
  final Date startDate = version.getStartDate();
  final Date releaseDate = version.getReleaseDate();
  String prettyStartDate = null;
  if (startDate != null) {
    prettyStartDate = dateFieldFormat.format(startDate);
  }
  String prettyReleaseDate = null;
  if (releaseDate != null) {
    prettyReleaseDate = dateFieldFormat.format(releaseDate);
  }
  final VersionBean.Builder beanBuilder = new VersionBean.Builder()
      .setArchived(version.isArchived())
      .setDescription(version.getDescription())
      .setExpand(null)
      .setId(version.getId())
      .setName(version.getName())
      .setOverdue(versionManager.isVersionOverDue(version))
      .setProjectId(version.getProjectId())
      .setReleased(version.isReleased())
      .setUserReleaseDate(prettyReleaseDate)
      .setUserStartDate(prettyStartDate)
      .setSelf(createSelfURI(version));
  return beanBuilder.build();
}

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

if (releaseDate != null)
  if (!version.isReleased())

相关文章