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

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

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

Option.option介绍

暂无

代码示例

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

@Override
  public Option<String> apply(final ActionViewData input)
  {
    return option(input.value());
  }
}).flatMap(new Function<String, Option<Boolean>>()

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

public IssueTypeUpdateInput build()
  {
    return new IssueTypeUpdateInput(
        issueTypeToUpdateId,
        Option.option(name),
        Option.option(description),
        Option.option(avatarId));
  }
}

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

@Override
public Option<InputStream> getResourceAsStream(final String resourcePath)
{
  return Option.option(ClassPathResourceLoader.class.getResourceAsStream(resourcePath));
}

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

private VersionDeleteEvent(@Nonnull Version version,
    @Nullable Version mergedTo,
    @Nullable Version affectsVersionSwappedTo,
    @Nullable Version fixSwapVersion)
{
  super(version);
  this.mergedTo = option(mergedTo);
  this.affectsVersionSwappedTo = option(affectsVersionSwappedTo);
  this.fixVersionSwappedTo = option(fixSwapVersion);
}

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

/**
 * Return the old JIRA < 6.3.x stored license. Since 6.4 the location of the licenses has moved.
 *
 * @return the license stored in the < 6.3.x location or {@link Option#none()} if no such license exists.
 */
private Option<String> retrieveOldLicenseString()
{
  return Option.option(applicationProperties.getText(APKeys.JIRA_LICENSE));
}

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

@Override
public Function<String, Option<ApplicationUser>> getEntityByKeyFunction()
{
  return key -> option(userManager.getUserByKey(key));
}

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

Option<ApplicationRole> get(ApplicationKey key)
{
  notNull("key", key);
  return Option.option(roles.get(key));
}

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

private void initResources(final String... resourceIds)
{
  for (String resourceId : resourceIds)
  {
    resources.put(resourceId, Option.option(getResourceDescriptor("velocity", resourceId)));
  }
}

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

public IssueTypeCreateInput build()
  {
    checkArgument(type != null);
    checkArgument(name != null);
    return new IssueTypeCreateInput(name,
        type, Option.option(description));
  }
}

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

@Override
  public Option<Project> apply(final String projectKey)
  {
    return Option.option(projectManager.getProjectObjByKey(projectKey));
  }
}

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

@Nonnull
@Override
public ServiceOutcome<Page<Version>> getVersionsByProject(@Nullable final ApplicationUser user, @Nonnull final Project project, @Nonnull final PageRequest pageRequest, @Nullable final OrderByRequest<VersionExtractableField> orderBy)
{
  return getVersionsByProject(user, project, pageRequest, option(orderBy));
}

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

@Override
public Function<Long, Option<ApplicationUser>> getEntityByIdFunction()
{
  return id -> option(userManager.getUserById(id).orElse(null));
}

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

@Override
  public Option<ChangeHistory> apply(@Nullable final Long input)
  {
    return Option.option(changeHistoryManager.getChangeHistoryById(input));
  }
};

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

public String getSelectedProjectType() throws GenericEntityException
{
  if(selectedProjectType != null){
    return selectedProjectType;
  }
  Option<String> lastSelectedProjectType = option(getSession().get(SessionKeys.BROWSE_PROJECTS_CURRENT_PROJECT_TYPE));
  return lastSelectedProjectType.getOrElse(ALL);
}

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

@Override
  public Option<IssueTypeWithID> apply(Long id)
  {
    return Option.option(IssueTypeWithID.fromIssueType(issueTypeManager.getIssueType(String.valueOf(id))));
  }
};

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

DefaultProjectPermission(String key, String nameKey, String descriptionKey,
             ProjectPermissionCategory category, @Nullable Condition condition)
{
  this.key = key;
  this.projectPermissionKey = new ProjectPermissionKey(key);
  this.nameKey = nameKey;
  this.descriptionKey = descriptionKey;
  this.category = category;
  this.condition = option(condition).getOrElse(new AlwaysDisplayCondition());
}

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

private void importInitialData(final String jiraLicenseKey, final String serverId)
{
  final DatabaseInitialImporter databaseInitialImporter = ComponentAccessor.getComponent(DatabaseInitialImporter.class);
  // Load initial data with instant evaluation bits injected
  databaseInitialImporter.importInitialData(null, Option.option(serverId), Option.option(jiraLicenseKey));
  // initialize information on instant setup after all data are re-created
  // variables set during setup phase are lost
  final ApplicationProperties applicationProperties = ComponentAccessor.getApplicationProperties();
  applicationProperties.setOption(APKeys.JIRA_SETUP_IS_INSTANT, true);
  applicationProperties.setString(APKeys.JIRA_TITLE, "JIRA");
  applicationProperties.setString(APKeys.JIRA_MODE, "private");
}

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

@Override
public ServiceOutcome<IssueSecurityLevelScheme> getIssueSecurityLevelScheme(ApplicationUser user, final long schemeId)
{
  return asAdminOrProjectAdminWithAccessToScheme(user, schemeId, () -> {
    Supplier<ServiceOutcome<IssueSecurityLevelScheme>> notFoundSupplier =
        notFoundSupplier("rest.error.issuesecurityscheme.securityscheme.not.found", String.valueOf(schemeId));
    return Option.option(issueSecuritySchemeManager.getIssueSecurityLevelScheme(schemeId))
        .fold(notFoundSupplier, IssueSecuritySchemeServiceImpl.<IssueSecurityLevelScheme>okOutcome());
  });
}

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

@Override
public ServiceOutcome<IssueSecurityLevel> getIssueSecurityLevel(ApplicationUser user, final long securityLevelId)
{
  return asAdmin(user, () -> {
    Supplier<ServiceOutcome<IssueSecurityLevel>> notFoundSupplier =
        notFoundSupplier("rest.error.issuesecurityscheme.securitylevel.not.found", String.valueOf(securityLevelId));
    return Option.option(issueSecurityLevelManager.getSecurityLevel(securityLevelId))
        .fold(notFoundSupplier, IssueSecuritySchemeServiceImpl.<IssueSecurityLevel>okOutcome());
  });
}

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

private ErrorCollection validateUpdateProjectData(ApplicationUser user, String name, Project oldProject, ApplicationUser lead,
    String url, Long assigneeType, Long avatarId)
{
  final ErrorCollection errorCollection = ErrorCollections.empty();
  final I18nHelper i18nHelper = getI18nBean(user);
  validateProjectNameForUpdate(name, oldProject.getKey(), errorCollection, i18nHelper);
  validateProjectLead(Option.option(lead), errorCollection, i18nHelper);
  validateProjectUrl(url, errorCollection, i18nHelper);
  validateProjectAssigneeType(assigneeType, errorCollection, i18nHelper);
  validateAvatarId(avatarId, oldProject, errorCollection, i18nHelper);
  return errorCollection;
}

相关文章