Как вернуть значение по умолчанию в else? [code]@GetMapping("/byemail/{email}") public ResponseEntity getIndirizzoByEmail(@PathVariable("email") String email) {
Indirizzo indirizzo = indirizzoService.filtraPerEmail(email); if (indirizzo != null) { // convert entity to DTO IndirizzoDto indirizzoResponse = modelMapper.map(indirizzo, IndirizzoDto.class); return ResponseEntity.ok().body(indirizzoResponse); } else { return ResponseEntity.noContent().build(); --> How can I pass a default value? } } [/code] Мне нужно значение по умолчанию типа json