Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 24.04 server, but applications are described for Xubuntu 24.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

Optional person

Prev
UML and forward-reverse engineering
Next
Log4J

Implement methods for OptionalPerson using java.util.Optional and Java streams:

  1. Constructor — initialize personCache as a LinkedHashSet<Person> and personManager as a PersonManager.
  2. Optional<Person> findPerson(int id)
  3. Optional<Person> findPerson(String name, String surname)

NB
- Do not return null, always return Optional
- Name matching must remain case-insensitive and partial
- Do not modify the existing matchesId / matchesName helpers
- The test needs the activity16 MySQL database running

Prev
UML and forward-reverse engineering
Next
Log4J

 
 

Created by Valdis Vītoliņš on 2026-03-19 11:59
Last modified by Valdis Vītoliņš on 2026-11-25 12:48
XWiki Powered
Creative Commons Attribution 3.0 Unported License