com.atlassian.streams.api.common.Option.get()方法的使用及代码示例

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

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

Option.get介绍

暂无

代码示例

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

@HtmlSafe
  public Html apply(final Iterable<JiraActivityItem> activityItems)
  {
    return compoundRenderer.apply(activityItems).get();
  }
}

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

public Html renderTitleAsHtml(StreamsEntry entry)
{
  if (removed)
  {
    return new Html(i18nResolver.getText("streams.item.jira.title.remove.linked",
        authorsRenderer.apply(entry.getAuthors()),
        some(aggregatedItem.getActivityItem()).flatMap(issueRenderer).get(),
        issuesRenderer.apply(aggregatedItem.getRelatedActivityItems().getOrElse(
          ImmutableList.<JiraActivityItem>of()))));
  }
  return new Html(i18nResolver.getText("streams.item.jira.title.linked",
      authorsRenderer.apply(entry.getAuthors()),
      size(aggregatedItem.getRelatedActivityItems().getOrElse(ImmutableList.<JiraActivityItem>of())) + 1));
}

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

private String resolveText(String key, Serializable... arguments)
{
  String pattern = getTranslation(key);
  MessageFormat format = new MessageFormat(pattern, getCurrentLocale().get());
  return format.format(arguments);
}

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

public NonEmptyIterable<UserProfile> getUserProfiles(URI baseUri, JiraActivityItem jiraActivityItem)
{
  Iterable<String> usernames = jiraActivityItem.getChangeHistoryAuthors();
  final NonEmptyIterable<UserProfile> userProfiles = NonEmptyIterables.from(transform(usernames, getUserProfile(baseUri)))
      .getOrElse(ImmutableNonEmptyList.of(userProfileAccessor.getAnonymousUserProfile(baseUri)));
  return NonEmptyIterables.from(transform(userProfiles, addProfileMetadata(jiraActivityItem.getHistoryMetadata(), Iterables.isEmpty(usernames), baseUri))).get();
}

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

private String resolveText(String key, Serializable... arguments)
{
  String pattern = getTranslation(key);
  MessageFormat format = new MessageFormat(pattern, getCurrentLocale().get());
  return format.format(arguments);
}

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

@Override
public Option<Html> renderContentAsHtml(StreamsEntry entry)
{
  if (!removed)
  {
    return some(new Html(render(templateRenderer, "jira-link-field-update.vm", ImmutableMap.of(
      "comment", getAggregatedComments(aggregatedItem),
      "issueKeyHtml", some(aggregatedItem.getActivityItem()).flatMap(issueRenderer).get(),
      "linkText", linkingText(aggregatedItem.getActivityItem()),
      "linkedIssueKeysHtml", issuesRenderer.apply(aggregatedItem.getRelatedActivityItems()
          .getOrElse(ImmutableList.<JiraActivityItem>of()))))));
  }
  return none();
}

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

private String getTranslation(final String key)
{
  final Map<String, String> translations = getAllTranslationsForPrefix(key, getCurrentLocale().get());
  final String translation = translations.get(key);
  // Return the key if the key can't be resolved.
  return translation != null ? translation : key;
}

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

public Html renderTitleAsHtml(StreamsEntry entry)
  {
    return new Html(i18nResolver.getText("streams.item.jira.title.attached",
        authorsRenderer.apply(entry.getAuthors()),
        size(attachments),
        targetRenderer.apply(entry.getTarget().get()).get()));
  }
}

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

private String getTranslation(final String key)
{
  final Map<String, String> translations = getAllTranslationsForPrefix(key, getCurrentLocale().get());
  final String translation = translations.get(key);
  // Return the key if the key can't be resolved.
  return translation != null ? translation : key;
}

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

public Html renderTitleAsHtml(StreamsEntry entry)
  {
    return new Html(i18nResolver.getText("streams.item.jira.title.updated.field.exclude.value",
        authorsRenderer.apply(entry.getAuthors()),
        getFieldName(get(fieldChanges, 0)),
        min(attachments.size(), 1) + uniqueFieldSize(fieldChanges),
        activityObjectsRenderer.apply(entry.getActivityObjects()).get()));
  }
}

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

public Option<String> checkString(Option<String> value, String propertyName, int maxLength)
{
  if (value.isDefined())
  {
    checkString(value.get(), propertyName, maxLength);
  }
  return value;
}

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

public Html renderTitleAsHtml(StreamsEntry entry)
  {
    return new Html(i18nResolver.getText("streams.item.jira.title.updated.multiple.fields",
        authorsRenderer.apply(entry.getAuthors()),
        min(attachments.size(), 1) + uniqueFieldSize(fieldChanges),
        activityObjectsRenderer.apply(entry.getActivityObjects()).get()));
  }
}

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

public Option<Html> checkHtml(Option<Html> value, String propertyName, int maxLength)
{
  checkNotNull(value, propertyName);
  if (value.isDefined())
  {
    checkString(value.get().toString(), propertyName, maxLength);
  }
  return value;
}

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

private Html transitionWithoutResolution(final StreamsEntry entry)
  {
    return new Html(i18nResolver.getText("streams.item.jira.status.transition.without.resolution",
        authorsRenderer.apply(entry.getAuthors()),
        htmlEncode(statusName),
        activityObjectsRenderer.apply(entry.getActivityObjects()).get()));
  }
}

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

public StreamsEntry.Parameters<HasId, HasPostedDate, HasAlternateLinkUri, HasApplicationType, NeedsRenderer,
                NeedsVerb, NeedsAuthors> newCommentBuilder(URI baseUri, JiraActivityItem item)
{
  return entryBuilderFactory.newParams(item,
      uriProvider.getIssueCommentUri(baseUri, item.getComment().get()), baseUri);
}

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

public Html apply(String resolution)
  {
    return new Html(i18nResolver.getText("streams.item.jira.status.transition.with.resolution",
        authorsRenderer.apply(entry.getAuthors()),
        htmlEncode(statusName),
        activityObjectsRenderer.apply(entry.getActivityObjects()).get(),
        htmlEncode(resolution)));
  }
};

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

private Option<Pair<ActivityObjectType, ActivityVerb>> typeAndVerb(StreamsCrucibleActivityItem activityItem)
{
  Option<ActivityObjectType> type = type(activityItem);
  Option<ActivityVerb> verb = verb(activityItem);
  if (!type.isDefined() || !verb.isDefined())
  {
    return none();
  }
  return some(pair(type.get(), verb.get()));
}

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

public Option<Pair<Comment, Html>> get()
  {
    if (!item.getComment().isDefined())
    {
      return none();
    }
    return some(pair(item.getComment().get(), item.getComment().map(commentRenderer).get()));
  }
});

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

@Override
public Html renderTitleAsHtml(final StreamsEntry entry)
{
  String descriptionKey = historyMetadata.getActivityDescriptionKey();
  Html generatorDisplayName = participantRenderer.apply(historyMetadata.getGenerator());
  Html causeDisplayName = participantRenderer.apply(historyMetadata.getCause());
  final NonEmptyIterable<UserProfile> emptyAuthor = NonEmptyIterables.from(Collections.singleton(new UserProfile.Builder("").build())).get();
  return new Html(i18nResolver.getText(descriptionKey,
      originalEntry.renderTitleAsHtml(),
      streamsEntryRendererFactory.newAuthorsRenderer().apply(originalEntry.getAuthors()),
      new StreamsEntry(StreamsEntry.params(originalEntry).authors(emptyAuthor), i18nResolver).renderTitleAsHtml(),
      generatorDisplayName, causeDisplayName));
}

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

private void fetchMetadata(final AggregatedJiraActivityItem aggregatedItem)
{
  JiraActivityItem activityItem = aggregatedItem.getActivityItem();
  if (activityItem.getChangeHistory().isDefined())
  {
    HistoryMetadataManager.HistoryMetadataResult historyMetadata = historyMetadataManager.getHistoryMetadata(activityItem.getChangeHistory().get(), authenticationContext.getUser());
    activityItem.setHistoryMetadata(option(historyMetadata.getHistoryMetadata()));
  }
}

相关文章