我试图转换这部分代码以摆脱lambda表达式,以便它能够在java 7中工作
pausedTriggerGroups.stream().
forEach((group) -> {
pausedTriggerGroups.remove(group);
});
我在java7中的代码如下
pausedTriggerGroups.removeAll(pausedTriggerGroups);
和此:
triggersByKey.values(new TriggerByJobPredicate(jobKey))
.stream()
.map(v -> (OperableTrigger) v.getTrigger())
.collect(Collectors.toList());
到此:
List<OperableTrigger> result= new ArrayList<>();
for (TriggerWrapper value : triggersByKey.values()) {
result.add(value.getTrigger());
}
和此:
triggersByKey.values().stream().
filter((trigger) -> (trigger.jobKey.equals(jobKey))).
forEach((trigger) -> {
trigList.add(trigger);
});
到此:
for (TriggerWrapper triggerWrapper : triggersByKey.values()) {
if(triggerWrapper.getTrigger().getJobKey().equals(jobKey)){
trigList.add(triggerWrapper);
}
}
转化是好还是有错误?