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

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

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

Option.option介绍

暂无

代码示例

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

public PostReplyError(Type type, Throwable cause)
{
  this.type = checkNotNull(type, "type");
  this.cause = option(cause);
}

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

public Option<String> apply(String s)
  {
    return option(trimToNull(s));
  }
}

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

private Option<Locale> getCurrentLocale()
{
  return Option.option(currentLocale.get());
}

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

public AggregatedJiraActivityItem(JiraActivityItem item,
    Iterable<JiraActivityItem> relatedActivityItems,
    Pair<ActivityObjectType, ActivityVerb> activity)
{
  this.item = checkNotNull(item, "item");
  this.relatedActivityItems = option(relatedActivityItems);
  this.activity = checkNotNull(activity, "activity");
}

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

private Option<String> getInitialSummary(Issue issue, Iterable<ChangeHistory> histories)
{
  for (final ChangeHistory changeHistory : histories)
  {
    for (String oldSummary : getSummaryIfChanged(changeHistory, true))
    {
      return option(oldSummary);
    }
  }
  return option(issue.getSummary());
}

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

private Option<String> getInitialDescription(Issue issue, Iterable<ChangeHistory> histories)
{
  for (final ChangeHistory changeHistory : histories)
  {
    for (GenericValue changeItem : filter(getChangeItems(changeHistory), description))
    {
      return option(changeItem.getString("oldstring"));
    }
  }
  return option(issue.getDescription());
}

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

@Override
  public ThumbnailItem apply(@Nullable Attachment attachment) {
    return option(thumbnailManager.getThumbnail(attachment)).
        map(mkThumbnailItem(attachment, baseUri)).
        getOrElse(brokenThumbnailItem(attachment, baseUri));
  }
};

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

@Test
public void assertThatUsernameIsUriEncodedInProfilePictureUri()
{
  URI baseUri = URI.create("http://localhost/streams");
  assertThat(userProfileAccessor.getUserProfile(baseUri, "user 2").getProfilePictureUri(),
      is(equalTo(option(getProfilePictureUri(getProfilePicParameter("user 2"))))));
}

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

public Option<String> getSpaceKey()
{
  if (entity instanceof SpaceContentEntityObject)
  {
    return option(((SpaceContentEntityObject) entity.getLatestVersion()).getSpaceKey());
  }
  else
  {
    return none();
  }
}

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

@Override
public Option<String> getSpaceKey()
{
  final ContentEntityObject container = comment.getContainer();
  if (container instanceof SpaceContentEntityObject)
  {
    return option(((SpaceContentEntityObject) container).getSpaceKey());
  }
  else
  {
    return none();
  }
}

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

private Option<Html> getDescription(Issue issue)
  {
    String newValueString = changeItem.getString("newstring");
    if (!isBlank(newValueString))
    {
      return option(helper.renderIssueFieldValue(issue, DESCRIPTION, newValueString)).flatMap(trimHtmlToNone());
    }
    return none();
  }
}

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

public Option<Attachment> apply(GenericValue v)
  {
    return option(v.getString("newvalue")).map(parseLong()).flatMap(lookupAttachment);
  }
};

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

public Option<String> getSpaceKey()
{
  if (attachment.getSpace() != null)
  {
    return option(attachment.getSpace().getKey());
  }
  else
  {
    return none();
  }
}

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

public CommentRenderer(final TemplateRenderer templateRenderer,
    final Function<StreamsEntry, Html> titleRenderer,
    final Html comment,
    Option<URI> styleLink)
{
  this(templateRenderer, titleRenderer, none(String.class), some(comment), styleLink);
}

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

private ActivityObject buildActivityObject(URI baseUri, RepositoryHandle repositoryHandle)
  {
    URI repositoryUri = uriProvider.getRepositoryUri(baseUri, repositoryHandle);
    return new ActivityObject(ActivityObject.params()
      .id(new StreamsUriBuilder().setUrl(repositoryUri.toASCIIString()).getUri().toASCIIString())
      .activityObjectType(repository())
      .title(option(repositoryHandle.getCfg().getRepositoryTypeConfig().getDescription()))
      .alternateLinkUri(repositoryUri));
  }
}

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

public ActivityObject newActivityObject(RemoteAttachment attachment)
{
  return new ActivityObject(ActivityObject.params().
    id(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + attachment.getDownloadUrl()).
    activityObjectType(file()).
    title(option(attachment.getName())).
    alternateLinkUri(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + attachment.getDownloadUrl())));
}

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

public ActivityObject newActivityObject(AttachmentActivityItem.Entry attachment)
{
  return new ActivityObject(ActivityObject.params().
    id(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + attachment.getDownloadPath()).
    activityObjectType(file()).
    title(option(attachment.getName())).
    alternateLinkUri(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + attachment.getDownloadPath())));
}

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

public ActivityObject build(URI baseUri, Issue issue, String issueSummary)
{
  return new ActivityObject(ActivityObject.params()
    .id(new StreamsUriBuilder().setUrl(issueUriBuilder.getIssueUri(baseUri, issue).toASCIIString()).getUri().toASCIIString())
    .activityObjectType(issue())
    .title(option(issue.getKey()))
    .summary(some(issueSummary))
    .alternateLinkUri(issueUriBuilder.getIssueUri(baseUri, issue)));
}

代码示例来源: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()));
  }
}

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

public ActivityObject newActivityObject(SpaceDescription space)
{
  return new ActivityObject(ActivityObject.params().
    id(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + space.getUrlPath()).
    activityObjectType(space.isPersonalSpace() ? personalSpace() : space()).
    title(option(space.getDisplayTitle())).
    alternateLinkUri(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + space.getUrlPath())));
}

相关文章