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

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

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

Option.getOrNull介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.jira/jira-issue-link-confluence-plugin

private boolean isThereApplicationLinkFor(final URI pageUri)
{
  appLink = confluenceAppLinks.forPage(pageUri).getOrNull();
  return appLink != null;
}

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

@Override
public String getUrl(Project context)
{
  return getUrl(ImmutableMap.<String, Object>of("project", context)).getOrNull();
}

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

public CustomFieldType getCustomFieldType(String key)
{
  return customFieldTypeModuleDescriptors.getCustomFieldType(key).getOrNull();
}

代码示例来源:origin: com.atlassian.labs.hipchat/hipchat-for-jira-plugin

@ActionViewDataMappings ({ SUCCESS })
public Map<String, Object> getData() {
  final ApplicationUser applicationUser = getLoggedInApplicationUser();
  return ImmutableMap.<String, Object>builder()
            .put(ISSUE_KEY_PARAMETER_KEY, issueKey)
            .put(DEDICATED_ROOM_PARAMETER_KEY, dedicatedRoom.getOrNull())
            .put(HIPCHAT_USERNAME_PARAMETER_KEY,
              hipChatUserFinder.findHipChatUser(new UserKey(applicationUser.getKey())).getOrNull())
            .build();
}

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

@SuppressWarnings ("ConstantConditions")
public MailServer getMailServer(String name)
{
  return mailServerCache.get(Option.option(name)).getOrNull();
}

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

private List<Map<String, Object>> getProjectAdminNavPanelSections()
{
  final List<WebPanelModuleDescriptor> webPanelDescriptors = webInterfaceManager.getDisplayableWebPanelDescriptors(NAV_PANEL_LOCATION, Collections.emptyMap());
  final List<Map<String, Object>> panelSectionList = Lists.newArrayListWithExpectedSize(webPanelDescriptors.size());
  for (final WebPanelModuleDescriptor panelDescriptor : webPanelDescriptors)
  {
    CollectionUtils.addIgnoreNull(panelSectionList,
        SafePluginPointAccess.call(() -> makeSideMenuSoyRenderDataForWebPanel(panelDescriptor)).getOrNull());
  }
  return panelSectionList;
}

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

private boolean isVelocityView(final Option<ActionInfo.ViewInfo> viewInfo)
{
  boolean isVelocity = false;
  if (viewInfo.isDefined())
  {
    isVelocity = "velocity".equals(getAttrValue(viewInfo, "type").getOrNull());
    isVelocity |= viewInfo.get().getViewValue().endsWith(".vm");
  }
  return isVelocity;
}

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

private static String toShortLicenseString(Option<? extends LicenseDetails> details)
{
  return details.map(LicenseDetails::getLicenseString)
      .map(str -> StringUtils.abbreviate(str, 100))
      .getOrNull();
}

代码示例来源:origin: com.atlassian.confluence/confluence-stateless-test-runner

private List<Pair<String, Option<Level>>> configureLevels()
{
  long start = System.currentTimeMillis();
  List<Pair<String, Option<Level>>> transformed = newArrayList();
  for (Pair<String, Option<Level>> level : levels)
  {
    Level newLevel = restClient.getAdminSession().getLoggingComponent().setLogLevel(level.left(), level.right().getOrNull());
    transformed.add(pair(level.left(), option(newLevel)));
  }
  LOG.info("Changed log levels in {}ms: {}", System.currentTimeMillis() - start, levels);
  return transformed;
}

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

@Override
  public AttachmentException apply(final AttachmentError attachmentError)
  {
    return new AttachmentException(String.format("Got error while saving attachment %s: %s",
        attachmentError.getFilename(), attachmentError.getLogMessage()),
        attachmentError.getException().getOrNull());
  }
}));

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

/**
 * Move the license from the UPM store into a location for upgrade. This logically removes the license from JIRA
 * but leaves it accessible to upgrade tasks through {@link #getUpgrade()} or {@link #getCurrentOrUpgrade()}.
 */
public void moveToUpgradeStore()
{
  applicationProperties.setText(UPM_SERVICE_DESK_LICENSE_DELETED_KEY, get().getOrNull());
  applicationProperties.setText(UPM_SERVICE_DESK_LICENSE_KEY, null);
}

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

@Override
public void deleteVersion(final ApplicationUser applicationUser,
    final Version versionToDelete,
    final Option<Version> affectsSwapVersion,
    final Option<Version> fixSwapVersion)
{
  swapVersionForRelatedIssues(applicationUser, versionToDelete, affectsSwapVersion, fixSwapVersion);
  deleteVersionWithoutPublishingAnEvent(versionToDelete);
  eventPublisher.publish(new VersionDeleteEvent.VersionDeleteEventBuilder(versionToDelete)
      .affectsVersionSwappedTo(affectsSwapVersion.getOrNull())
      .fixVersionSwappedTo(fixSwapVersion.getOrNull())
      .createEvent());
}

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

@Override
public void deleteIssueType(final ApplicationUser user, @Nonnull final DeleteValidationResult validationResult)
{
  checkNotNull(validationResult);
  checkArgument(validationResult.isValid());
  checkNotNull(validationResult.getDeleteIssueTypeInput());
  checkArgument(validationResult.getDeleteIssueTypeInput().isDefined());
  final String issueTypeToDeleteId = validationResult.getDeleteIssueTypeInput().get().getIssueTypeToDeleteId();
  issueTypeManager.removeIssueType(issueTypeToDeleteId,
      validationResult.getDeleteIssueTypeInput().get().getAlternativeIssueTypeId().getOrNull());
}

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

public Builder(PermissionSchemeInput schemeData)
{
  this.name = schemeData.getName();
  this.description = schemeData.getDescription().getOrNull();
  setPermissions(schemeData.getPermissions());
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

@CheckValidToken
public Result adminPatterns()
{
  final Iterable<PatternSource> patterns = patternService.getAllPatterns(AC.getUser().getOrNull(), AC.getAcHost());
  return ok(views.html.admin.pattern.render(Lists.newArrayList(patterns)));
}

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

private boolean isUserEditable(@Nonnull final ApplicationUpdateResult applicationUpdateResult)
{
  final ApplicationUser loggedInUser = authContext.getLoggedInUser();
  final Option<ApplicationUser> userOption = applicationUpdateResult.getApplicationUser();
  final ApplicationUser user = userOption.getOrNull();
  return userOption.isDefined() && loggedInUser != null && userManager.canUpdateUser(user) &&
      (permissionManager.hasPermission(GlobalPermissionKey.SYSTEM_ADMIN, loggedInUser) ||
          !permissionManager.hasPermission(GlobalPermissionKey.SYSTEM_ADMIN, user));
}

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

public SchemeEntity schemeEntity(final PermissionGrantInput permissionGrant, @Nullable Long schemeId)
{
  return new SchemeEntity(
      null,
      permissionGrant.getHolder().getType().getKey(),
      permissionGrant.getHolder().getParameter().getOrNull(),
      permissionGrant.getPermission(),
      null,
      schemeId
  );
}

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

public SchemeEntity schemeEntity(final PermissionGrant permissionGrant, Long schemeId)
{
  checkNotNull(schemeId);
  return new SchemeEntity(
      permissionGrant.getId(),
      permissionGrant.getHolder().getType().getKey(),
      permissionGrant.getHolder().getParameter().getOrNull(),
      permissionGrant.getPermission(),
      null,
      schemeId
  );
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

@CheckValidToken
public Result downVote(final Long issueId, final Long matchId)
{
  final boolean voted = reportService.validateAndDownVote(AC.getUser().getOrNull(), AC.getAcHost(), issueId, matchId);
  return voted ? ok() : badRequest();
}

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

private SchemeEntity withFixedEntityTypeId(SchemeEntity original)
{
  if (original.getEntityTypeId() instanceof ProjectPermissionKey)
  {
    return original;
  }
  ProjectPermissionKey permissionKey = PermissionSchemeUtil.getPermissionKey(original).getOrNull();
  return new SchemeEntity(original.getId(), original.getType(), original.getParameter(),
      permissionKey, original.getTemplateId(), original.getSchemeId());
}

相关文章