如何将此代码转换为 java 8 流。
试图为每个使用,但失败了。For 循环代码正在工作。
for(RestrictedInstrument restrictedInstrument : restrictedInstruments){
List<Identifier> identifierList = restrictedInstrument.getIdentifier();
setTicker(matrix, identifierList);
}
setTicker()
方法应该用矩阵 Object 和identifierList
.
你可以只使用List.forEach()
:
restrictedInstruments.forEach(i -> setTicker(matrix, i.getIdentifier()));
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句