本文整理了Java中com.atlassian.fugue.Either.map()
方法的一些代码示例,展示了Either.map()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Either.map()
方法的具体详情如下:
包路径:com.atlassian.fugue.Either
类名称:Either
方法名:map
暂无
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public Either<ErrorCollection, PermissionGrantInput> fromBean(final PermissionGrantBean grantBean)
{
return validated(grantBean).map(new Function<PermissionGrantBean, PermissionGrantInput>()
{
@Override
public PermissionGrantInput apply(final PermissionGrantBean grantBean)
{
return PermissionGrantInput.newGrant(
holder(getActorType(grantBean).get(), grantBean.getHolder().getParameter()),
new ProjectPermissionKey(grantBean.getPermission()));
}
});
}
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public Either<ErrorCollection, Collection<PermissionGrantInput>> fromBean(final List<PermissionGrantBean> permissions)
{
return sequenceRight(transform(firstNonNull(permissions, Collections.<PermissionGrantBean>emptyList()), new Function<PermissionGrantBean, Either<ErrorCollection, PermissionGrantInput>>()
{
@Override
public Either<ErrorCollection, PermissionGrantInput> apply(final PermissionGrantBean grantBean)
{
return fromBean(grantBean);
}
})).map(new Function<Iterable<PermissionGrantInput>, Collection<PermissionGrantInput>>()
{
@Override
public Collection<PermissionGrantInput> apply(final Iterable<PermissionGrantInput> grants)
{
return ImmutableList.copyOf(grants);
}
});
}
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public Either<ErrorCollection, PermissionSchemeInput> apply(final PermissionSchemeBean permissionScheme)
{
return fromBean(permissionScheme.getPermissions()).map(new Function<Collection<PermissionGrantInput>, PermissionSchemeInput>()
{
@Override
public PermissionSchemeInput apply(final Collection<PermissionGrantInput> permissionGrants)
{
return PermissionSchemeInput.builder(permissionScheme.getName())
.setDescription(permissionScheme.getDescription())
.setPermissions(permissionGrants)
.build();
}
});
}
});
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public Either<AttachmentError, ChangeItemBean> apply(
@SuppressWarnings ("NullableProblems") final TemporaryWebAttachment tempAttachment)
{
final Either<AttachmentError, ChangeItemBean> conversionResult = attachmentManager.convertTemporaryAttachment(
ConvertTemporaryAttachmentParams.builder()
.setAuthor(user)
.setIssue(issue)
.setTemporaryAttachmentId(tempAttachment.getTemporaryAttachmentId())
.setFilename(tempAttachment.getFilename())
.setContentType(tempAttachment.getContentType())
.setFileSize(tempAttachment.getSize())
.setCreatedTime(tempAttachment.getCreated())
.build()
);
return conversionResult.map(new Function<ChangeItemBean, ChangeItemBean>()
{
@Override
public ChangeItemBean apply(@SuppressWarnings ("NullableProblems") final ChangeItemBean changeItemBean)
{
monitor.removeById(selectedAttachmentId);
return changeItemBean;
}
});
}
};
内容来源于网络,如有侵权,请联系作者删除!