本文整理了Java中com.atlassian.streams.api.common.Option.flatMap()
方法的一些代码示例,展示了Option.flatMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option.flatMap()
方法的具体详情如下:
包路径:com.atlassian.streams.api.common.Option
类名称:Option
方法名:flatMap
暂无
代码示例来源:origin: com.atlassian.streams/streams-common
public Option<Html> apply(Function<ActivityObject, Option<Html>> renderer)
{
return target.flatMap(renderer);
}
};
代码示例来源:origin: com.atlassian.streams/streams-core-plugin
public Option<Html> apply(Function<ActivityObject, Option<Html>> renderer)
{
return target.flatMap(renderer);
}
};
代码示例来源:origin: com.atlassian.streams/streams-core-plugin
public Option<Html> apply(StreamsEntry entry, Boolean truncate)
{
return strippedComment.flatMap(renderF(entry, truncate));
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
@Override
public final Option<Html> renderContentAsHtml(StreamsEntry entry)
{
return commentHtml.get().flatMap(renderComment(false));
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
@Override
public final Option<Html> renderSummaryAsHtml(StreamsEntry entry)
{
return commentHtml.get().flatMap(renderComment(true));
}
代码示例来源:origin: com.atlassian.streams/streams-common
public Option<Html> apply(StreamsEntry entry, Boolean truncate)
{
return strippedComment.flatMap(renderF(entry, truncate));
}
代码示例来源:origin: com.atlassian.streams/streams-fisheye-plugin
public Option<Html> apply(Iterable<SummaryItem> items)
{
return compoundRenderer.apply(items).flatMap(trimHtmlToNone()).map(htmlToString()).map(capitalizeFirstLetter);
}
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
public Option<Html> apply(JiraActivityItem activityItem)
{
return activityItem.getComment().map(commentRenderer).flatMap(trimHtmlToNone());
}
};
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
public Option<String> getComment()
{
return option(attachment.getVersionComment()).flatMap(trimToNone());
}
代码示例来源:origin: com.atlassian.streams/streams-core-plugin
public Html apply(StreamsEntry entry)
{
Option<Html> objectHtml = activityObjectRenderer.flatMap(render(entry.getActivityObjects()));
Option<Html> targetHtml = targetRenderer.flatMap(render(entry.getTarget()));
return new Html(getText(
key,
concat(
ImmutableList.of(authorsRenderer.apply(entry.getAuthors())),
objectHtml.map(singletonList(Html.class)).getOrElse(ImmutableList.<Html>of()),
targetHtml.map(singletonList(Html.class)).getOrElse(ImmutableList.<Html>of()))));
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
public Html apply(Iterable<Attachment> attachments)
{
Pair<? extends Iterable<Attachment>, ? extends Iterable<Attachment>> init = pair(ImmutableList.<Attachment>of(), ImmutableList.<Attachment>of());
Pair<? extends Iterable<Attachment>, ? extends Iterable<Attachment>> items = Fold.foldl(attachments, init, splitAttachments());
return new Html(render(templateRenderer, "attachment-list.vm", ImmutableMap.of(
"comment", withComment ? item.getComment().map(helper.renderComment()).flatMap(trimHtmlToNone()) : none(),
"attachments", ImmutableList.copyOf(transform(items.first(), asAttachmentItem(baseUri))),
"thumbnails", ImmutableList.copyOf(transform(items.second(), asThumbnailItem(baseUri))))));
}
代码示例来源:origin: com.atlassian.streams/streams-common
public Html apply(StreamsEntry entry)
{
Option<Html> objectHtml = activityObjectRenderer.flatMap(render(entry.getActivityObjects()));
Option<Html> targetHtml = targetRenderer.flatMap(render(entry.getTarget()));
return new Html(getText(
key,
concat(
ImmutableList.of(authorsRenderer.apply(entry.getAuthors())),
objectHtml.map(singletonList(Html.class)).getOrElse(ImmutableList.<Html>of()),
targetHtml.map(singletonList(Html.class)).getOrElse(ImmutableList.<Html>of()))));
}
代码示例来源:origin: com.atlassian.streams/streams-crucible-plugin
private String buildSummaryContent()
{
return render(templateRenderer, "summarize-content.vm", ImmutableMap
.<String, Object>of("reviewSummary", summary(review).map(stripBasicMarkup()).flatMap(trimToNone())));
}
代码示例来源: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-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<RemoteIssueLink> apply(GenericValue v)
{
return option(v.getString("newvalue")).map(parseLong()).flatMap(lookupRemoteIssueLink);
}
};
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
@Override
public Option<Html> renderContentAsHtml(final StreamsEntry entry)
{
return some(new Html(render(templateRenderer, "updated-field-list.vm", ImmutableMap.of(
"comment", item.getComment().map(commentRenderer).flatMap(trimHtmlToNone()),
"fieldChanges", transform(fieldChanges, renderFieldChanges()),
"attachments", attachments,
"attachmentsRenderer", attachmentsRenderer))));
}
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
@Override
public Html renderTitleAsHtml(StreamsEntry entry)
{
return entry.getTarget().flatMap(targetRenderer).map(renderAttachedTo(entry)).getOrElse(renderAttached(entry));
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
@Override
public Option<Html> renderContentAsHtml(StreamsEntry entry)
{
return some(new Html(render(templateRenderer, "jira-remote-issue-comment-block.vm", ImmutableMap.of(
"comment", item.getComment().map(helper.renderComment()).flatMap(trimHtmlToNone())))));
}
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
private Supplier<Option<Html>> contentAsHtml(final ContentEntityObject entity, final BodyContent bodyContent)
{
return () -> content(entity, pageManager.getPreviousVersion(entity), bodyContent)
.map(compose(html(), unescapeLineBreaks())).flatMap(trimHtmlToNone());
}
内容来源于网络,如有侵权,请联系作者删除!