嗨! try 使用此流,但我打开了NoSuchElementException
var scores = findAllByBarcode
.stream()
.iterator()
.next()
.getMpProductFeedbacks()
.stream()
.filter(mpProductFeedback -> mpProductFeedback.getId()==mpProductFeedbackId)
.iterator()
.next()
.getMpPersonScores()
.stream()
.map(mpPersonScore -> {
var score = new ScoreType();
score.setUserScore(mpPersonScore.getMpPersonScore());
score.setUser(mpPersonScore.getMpPersonLogin());
score.setUserComment(mpPersonScore.getMpPersonComment());
return score;
})
.toList();
部件后出现异常
filter(mpProductFeedback -> mpProductFeedback.getId()==mpProductFeedbackId)
.iterator()
.next()
try 使用orElse,但它只能与.equals一起使用 我已经有了==在两只长龙之间.