本文整理了Java中com.atlassian.streams.api.common.Option.some()
方法的一些代码示例,展示了Option.some()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option.some()
方法的具体详情如下:
包路径:com.atlassian.streams.api.common.Option
类名称:Option
方法名:some
暂无
代码示例来源:origin: com.atlassian.streams/streams-thirdparty-api
public Builder(URI url)
{
errors.checkAbsoluteUri(some(url), "url");
this.url = url;
}
代码示例来源:origin: com.atlassian.streams/streams-common
public Option<Html> apply(String title, Option<Html> titleAsHtml)
{
return some(new Html(escapeHtml(title)));
}
});
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
public Option<ContributorQuery> apply(String username)
{
if (isBlank(username))
{
return none();
}
return some(new ContributorQuery(username));
}
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
public JiraActivityItem(final Issue issue, final String displaySummary, final Pair<ActivityObjectType, ActivityVerb> activity,
final ChangeHistory changeHistory)
{
this.issue = checkNotNull(issue, "issue");
this.displaySummary = checkNotNull(displaySummary, "initialSummary");
this.activity = checkNotNull(activity, "activity");
this.changeHistory = some(checkNotNull(changeHistory, "changeHistory"));
comment = none();
date = changeHistory.getTimePerformed();
initialDescription = none();
}
代码示例来源:origin: com.atlassian.streams/streams-crucible-plugin
@Override
public Option<Html> renderContentAsHtml(final StreamsEntry entry)
{
return some(new Html(buildSummaryContent()));
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatProjectIdentifierReturnsProjectFilterKey()
{
assertThat(provider.getFilterKey(getProjectEntityIdentifier(PROJECT_ENTITY_KEY)),
equalTo(some(StandardStreamsFilterOption.PROJECT_KEY)));
}
代码示例来源:origin: com.atlassian.streams/streams-core-plugin
public Option<Pair<String, String>> get()
{
if (userManager.getRemoteUsername() != null)
{
return some(param);
}
else
{
return none();
}
}
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatUserViewPermissionIsTrueWhenAppropriate()
{
setProjectViewPermission(PROJECT_ENTITY_KEY, true);
assertThat(provider.getCurrentUserViewPermission(getProjectEntityIdentifier(PROJECT_ENTITY_KEY)),
equalTo(some(true)));
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatUserEditPermissionIsFalseWhenAppropriate()
{
setProjectEditPermission(PROJECT_ENTITY_KEY, false);
assertThat(provider.getCurrentUserEditPermission(getProjectEntityIdentifier(PROJECT_ENTITY_KEY)),
equalTo(some(false)));
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatIssueIdentifierReturnsIssueUri()
{
assertThat(provider.getEntityURI(getIssueEntityIdentifier(ISSUE_ENTITY_KEY)),
equalTo(some(getIssueUri(ISSUE_ENTITY_KEY))));
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatUsernameIsUriEncodedInProfileUri()
{
URI baseUri = URI.create("http://localhost/streams");
assertThat(userProfileAccessor.getUserProfile(baseUri, "user 2").getProfilePageUri(),
is(equalTo(some(getProfileUri("user 2")))));
}
代码示例来源:origin: com.atlassian.streams/streams-testing
@Test
public void assertThatProjectIdentifierReturnsProjectUri()
{
setProjectExists(PROJECT_ENTITY_KEY, true);
assertThat(provider.getEntityURI(getProjectEntityIdentifier(PROJECT_ENTITY_KEY)),
equalTo(some(getProjectUri(PROJECT_ENTITY_KEY))));
}
代码示例来源:origin: com.atlassian.streams/streams-crucible-plugin
@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
if (identifier.getType().equals(project().iri()))
{
return some(URI.create(applicationProperties.getBaseUrl() + PROJECT_URL_PREFIX + identifier.getValue()));
}
return none();
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
private Link getIconLink(final String baseUrl, final Issue issue)
{
URI uri = URI.create(issue.getIssueTypeObject().getIconUrl());
IssueType issueType = issue.getIssueTypeObject();
if (!uri.isAbsolute())
{
uri = URI.create(baseUrl + issue.getIssueTypeObject().getIconUrl());
}
return new Link(uri, ICON_LINK_REL, some(issueType.getNameTranslation()));
}
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
public Option<Html> apply(final JiraActivityItem activityItem)
{
return some(new Html(render(templateRenderer, "jira-issue-link.vm",
ImmutableMap.of("issue", activityItem.getIssue(),
"issueUri", uriProvider.getIssueUri(baseUri, activityItem.getIssue()).toASCIIString(),
"issueSummary", activityItem.getDisplaySummary(),
"withSummary", withSummary))));
}
}
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
if (identifier.getType().equals(space().iri()))
{
return some(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + URL_PREFIX + encode(identifier.getValue())));
}
return none();
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
@Override
public Option<URI> getEntityURI(EntityIdentifier identifier)
{
if (identifier.getType().equals(project().iri())
|| identifier.getType().equals(issue().iri()))
{
return some(URI.create(applicationProperties.getBaseUrl() + BROWSE + identifier.getValue()));
}
return none();
}
代码示例来源:origin: com.atlassian.streams/streams-fisheye-plugin
public Option<Html> apply(SummaryItem item)
{
if (item.getFileRevisionCount() > 0)
{
return some(new Html(i18nResolver.getText("streams.item.fisheye.more.files." +
item.getState().toString().toLowerCase(),
item.getFileRevisionCount())));
}
return none();
}
}
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
public UserProfile getAnonymousUserProfile(URI baseUri)
{
return new UserProfile.Builder(i18nResolver.getText("streams.confluence.authors.unknown.username"))
.fullName(i18nResolver.getText("streams.confluence.authors.unknown.fullname"))
.profilePictureUri(some(getAnonymousProfilePictureUri(baseUri)))
.build();
}
代码示例来源:origin: com.atlassian.streams/streams-confluence-plugin
@Override
public Html renderTitleAsHtml(StreamsEntry entry)
{
String key = "streams.item.confluence." +
(space.isPersonalSpace() ? personalSpace().key() : space().key()) + "." +
entry.getVerb().key();
Function<StreamsEntry, Html> titleRenderer = rendererFactory.newTitleRenderer(key,
rendererFactory.newAuthorsRenderer(),
some(rendererFactory.newActivityObjectsRenderer(spaceObjectRenderer())),
Option.none());
return titleRenderer.apply(entry);
}
内容来源于网络,如有侵权,请联系作者删除!