- orElseThrow: if personService.getAll() returns an Optional, then:
return personService.getAll().map(converter::toResource).orElseThrow(
() -> new NoResourceFound(...)
); - orElse: if personService.getByLastName() returns an optional:
return personService.getByLastName(lName).orElse(null);
Improving Structured Outputs in the Gemini API
6 hours ago

No comments:
Post a Comment