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

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

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

Option.foreach介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.hipchat.plugins/hipchat-core-plugin

@Override
public void addToUrl(final UrlBuilder urlBuilder)
{
  hipChatConfigurationManager.getApiToken().foreach(new Effect<String>()
  {
    @Override
    public void apply(final String token)
    {
      urlBuilder.addToQueryString(HIPCHAT_TOKEN_DEFINED, "true");
    }
  });
}

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

@Override
public void updateProjectConfiguration(@Nonnull final ProjectConfiguration projectConfiguration) {
  get(projectConfiguration).foreach(new Effect<ProjectConfigurationAO>() {
    @Override
    public void apply(ProjectConfigurationAO config) {
      updateProjectConfiguration(config, projectConfiguration);
    }
  });
}

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

/**
 * Close if and only if the specified expected value is the currently held reference.
 */
final void safeClose(final T expected)
{
  reference.safeReset(expected).foreach(resetEffect);
}

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

public static List<Document> foreach(final Collection<Option<Document>> documents)
{
  final LuceneDocumentsBuilder luceneDocumentsBuilder = new LuceneDocumentsBuilder();
  for (final Option<Document> document : documents)
  {
    document.foreach(luceneDocumentsBuilder);
  }
  return luceneDocumentsBuilder.builder.build();
}

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

@Override
public void update(final ApplicationUser user, final CommentUpdateValidationResult validationResult, final boolean dispatchEvent)
{
  validationResult.getComment().foreach(new Effect<Comment>()
  {
    @Override
    public void apply(final Comment comment)
    {
      commentManager.update(comment, validationResult.getCommentProperties().getOrElse(Collections.EMPTY_MAP), dispatchEvent);
    }
  });
}

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

public final void close()
{
  reference.reset().foreach(resetEffect);
}

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

@Override
public void deleteProjectConfiguration(@Nonnull ProjectConfiguration projectConfiguration) {
  get(projectConfiguration).foreach(new Effect<ProjectConfigurationAO>() {
    @Override
    public void apply(ProjectConfigurationAO config) {
      getAO().delete(config);
      cache.remove(config.getProjectId());
    }
  });
}

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

private void reIndex(final EntityProperty entityProperty)
{
  getIssue(entityProperty).foreach(new Effect<MutableIssue>()
  {
    @Override
    public void apply(final MutableIssue issue)
    {
      try
      {
        issueIndexManager.reIndex(issue, IssueIndexingParams.INDEX_ISSUE_ONLY);
      }
      catch (IndexException e)
      {
        log.error(String.format("Error during reindex of issue %s", issue.getKey()), e);
      }
    }
  });
}

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

@EventListener
  public void stop(final ComponentManagerShutdownEvent event)
  {
      executorReference.reset().foreach(new Effect<BoundedExecutorServiceWrapper>()
      {
        @Override
        public void apply(final BoundedExecutorServiceWrapper boundedExecutorServiceWrapper)
        {
          final boolean terminated = boundedExecutorServiceWrapper.awaitTermination();
          if (!terminated)
          {
            log.warn("Failed to terminate " + BoundedExecutorServiceWrapper.class.getName());
          }
        }
      });

  }
}

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

@EventListener
public void onGroupMembershipCreatedEvent(GroupMembershipCreatedEvent event)
{
  groupEventHandler.onGroupMembershipCreatedEvent(event).foreach(store());
}

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

@EventListener
public void onProjectComponentUpdatedEvent(final ProjectComponentUpdatedEvent event)
{
  projectComponentEventHandler.onProjectComponentUpdatedEvent(event).foreach(store());
}

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

@EventListener
public void onGroupDeletedEvent(GroupDeletedEvent event)
{
  groupEventHandler.onGroupDeletedEvent(event).foreach(store());
}

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

@EventListener
public void onGroupMembershipDeletedEvent(GroupMembershipDeletedEvent event)
{
  groupEventHandler.onGroupMembershipDeletedEvent(event).foreach(store());
}

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

@EventListener
public void onProjectUpdatedEvent(final ProjectUpdatedEvent event)
{
  projectEventHandler.onProjectUpdatedEvent(event).foreach(store());
}

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

@EventListener
public void onVersionUpdatedEvent(final VersionUpdatedEvent event)
{
  versionEventHandler.onVersionUpdatedEvent(event).foreach(store());
}

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

@EventListener
public void onProjectCategoryUpdateEvent(final ProjectCategoryUpdateEvent event)
{
  projectEventHandler.onProjectCategoryUpdateEvent(event).foreach(store());
}

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

@EventListener
public void onUserDeleted(UserDeletedEvent event)
{
  userEventHandler.handleUserDeletedEvent(event).foreach(store());
}

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

@EventListener
public void onUserUpdatedEvent(UserUpdatedEvent event)
{
  userEventHandler.handleUserUpdatedEvent(event).foreach(store());
}

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

@EventListener
public void onGroupCreatedEvent(GroupCreatedEvent event)
{
  groupEventHandler.onGroupCreatedEvent(event).foreach(store());
}

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

@EventListener
public void onWorkflowDeletedEvent(WorkflowUpdatedEvent event)
{
  workflowEventHandler.onWorkflowUpdatedEvent(event).foreach(store());
}

相关文章