问答详情
源自:3-1 高阶操作符 flatMap

jdk8处理Op的stream问题

val reprofile=userList.stream() .map(user->ThirdPartyApi.findByUsername(user.getUsername())) .flatMap(o->o.isPresent() ? Stream.of(o.get()) : Stream.empty()) .peek(user->log.debug("userProfile :{}",user)) .collect(toList()); log.debug("profile{}",reprofile);

提问者:╰ァ君oシ 2021-01-09 18:05

个回答

  • itachy
    2021-06-20 19:15:12

    所以   你的问题是?