skip to Main Content

Redis – Java 8 Optional <List> returning True Why?

I have a REST Controller @GetMapping("/getByClientId/{clientId}") public ResponseEntity<Optional<List<EquityFeeds>>> getByClientId(@PathVariable("clientId") final String clientId) { Optional<List<EquityFeeds>> cId = Optional.ofNullable(equityFeedsService.findByClientId(clientId)); System.out.println("Client Id: "+cId); if(cId.isPresent()) { return ResponseEntity.ok(cId); } else { cId.orElseThrow(() -> new ClientIdNotFoundException(clientId)); } return ResponseEntity.ok(cId); } Service Class Code: public List<EquityFeeds>…

VIEW QUESTION
Back To Top
Search