ch.lambdaj.Lambda.closure()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(188)

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

Lambda.closure介绍

[英]Creates a generic (not typed) closure and binds it to the current thread
[中]创建泛型(非类型化)闭包并将其绑定到当前线程

代码示例

代码示例来源:origin: ru.yandex.qatools.camelot.utils/plugin-utils

@SuppressWarnings("unchecked")
  public static <T> List<T> getPluginStatesList(AggregatorRepository<T> repo, boolean localKeysOnly) {
    Closure closure = closure(); of(repo).get(Lambda.var(String.class));
    return (List<T>) closure.each((localKeysOnly ? repo.localKeys() : repo.keys()));
  }
}

代码示例来源:origin: jtalks-org/jcommune

/**
 * {@inheritDoc}
 */
@Override
public void createPoll(Poll poll) {
  this.getDao().saveOrUpdate(poll);
  Closure1<PollItem> closure = closure(PollItem.class);
  of(pollOptionDao).saveOrUpdate(var(PollItem.class));
  closure.each(poll.getPollItems());
  securityService.createAclBuilder().grant(GeneralPermission.WRITE)
      .to(groupDao.getGroupByName(AdministrationGroup.USER.getName()))
      .on(poll).flush();
}

相关文章