本文整理了Java中ch.lambdaj.Lambda.closure()
方法的一些代码示例,展示了Lambda.closure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lambda.closure()
方法的具体详情如下:
包路径:ch.lambdaj.Lambda
类名称: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();
}
内容来源于网络,如有侵权,请联系作者删除!