return Optional.ofNullable(brokerRepository.findOne(id))
            .map(broker -> new ResponseEntity<>(
                broker,
                HttpStatus.OK))
            .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));

  

相关文章:

  • 2021-09-29
  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2021-12-30
  • 2021-09-16
  • 2022-02-02
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案