本文整理了Java中ch.lambdaj.Lambda.var()
方法的一些代码示例,展示了Lambda.var()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lambda.var()
方法的具体详情如下:
包路径:ch.lambdaj.Lambda
类名称:Lambda
方法名:var
[英]Defines a free variable of the given Class for the currently active closure
[中]为当前活动闭包定义给定类的自由变量
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!