- 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);
4 classic reads, newly available on Google Books
10 hours ago
No comments:
Post a Comment